home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / VGADOC4B.ZIP / RAMDAC.TXT < prev    next >
Text File  |  1995-09-29  |  84KB  |  2,053 lines

  1. RAMDACs
  2.  
  3. AcuMos:
  4. ADAC1        15/16/24 bit.
  5.  
  6. Analog Devices:
  7. ADV471       6bit DAC       15 overlay registers
  8. ADV475       6bit DAC       15 overlay registers
  9. ADV476       6bit DAC
  10. ADV477       8bit DAC       15 overlay registers
  11. ADV478       6/8bit DAC     15 overlay registers
  12.  
  13. ADV7129      True-Color 192bit pixel bus
  14. ADV7160      True color 96bit pixel bus. 10bit DACs. HW cursor. PLL
  15. ADV7162
  16.  
  17. ATI:
  18. ATI68830     15/16/24bit    Up to 80 MHz    !
  19. ATI68860     15/16/24bit    "Spectra" DAC for Mach64
  20. ATI68875     15/16/24bit    Up to 135 MHz   ! Used in ATI Graphics Ultra +
  21.                              and Pro.  Similar to TI34075
  22. ATI68880                    Very similar to 68860
  23.  
  24. AT&T:
  25. ATT20c40x   ??
  26. ATT20c490    15/16/24 bit.  6/8 bit DAC.
  27. ATT20c491    15/16/24 bit.  6/8 bit DAC w/gamma correction
  28. ATT20c492    15/16/18 bit   6bit DACs. w/gamma correction
  29. ATT20c493    15/16/18 bit   6bit DACs
  30. ATT20c497    24bit          ?
  31. ATT20c498    24bit          16bit pixel databus  !
  32. ATT21c498    24bit          16bit pixel databus  ! What's the diff?
  33. ATT22c498    24bit          16bit pixel databus  !
  34.  
  35.  
  36. Avance Logic:
  37. ALG1101      16-bit.        Appears to be different from the other HiColor
  38.                             DACs.
  39. ALG1201      24bit
  40. ALG1301      24bit
  41.  
  42. Avasem:
  43. AV3676       6bit DAC
  44.  
  45. Brooktree:
  46. Bt458        8bit DAC       upto 135MHz. Not VGA compatible
  47. Bt476        6bit DAC.
  48. Bt477        6/8bit DAC
  49. Bt478        6/8bit DAC.
  50. Bt481        15/16bit
  51. Bt482        15/16bit
  52. Bt484        15/16/24bit    6/8bit DAC. Has hardware cursor.
  53. Bt485        15/16/24bit    6/8bit DAC. Has hardware cursor.
  54.  
  55. Chrontel
  56. CH8391
  57. CH8398       15/16/24bit and Clock chip
  58.  
  59. Cirrus Logic
  60. CL-GD5200    15/16/24 bit   Same as Acumos ADAC1
  61.  
  62. Diamond:
  63. SS2410       15/24 bit.     OEM version of MUSIC MU9c1880
  64.  
  65. IBM:
  66. RGB514       24bit.  144pin. HW cursor, 64bit pixel bus. Clock generator.
  67.                              packed 24bit pixels
  68. RGB524       24bit.  144pin. HW cursor, 64bit pixel bus. Dual clock generator
  69.                              packed 24bit pixels
  70. RGB525       24bit.  208pin. HW cursor, 64bit pixel bus. Clock generator
  71.                              packed 24bit pixels
  72. RGB526       24bit.  144pin. HW cursor, 64bit pixel bus. Dual clock generator
  73.                              packed 24bit pixels
  74. RGB528       24bit.  208pin. HW cursor, 128bit pixel bus. Dual clock generator
  75.                              supports 24bit packed pixels
  76. RGB530       24bit.  208pin. HW cursor. 96bit pixel bus. Clock generator,
  77.                              10bit DACs and LUTs, window attribute table
  78. RGB561       24bit.  304pin. HW cursor. 200bit pixel bus. Clock generator.
  79.                              10bit DACs and LUTs
  80. RGB624       24bit.  144pin. HW cursor, 64bit pixel bus, Dual clock generator
  81.                              packed 24bit pixels, YUV to RGB conversion
  82.  
  83.  
  84. ICS:
  85. ICS5300      24bit          Combined RAMDAC & Clock chip
  86. ICS5301
  87. ICS5342      24bit          Combined RAMDAC & Clock chip
  88.  
  89. IC Works:
  90. W30c498                     Similar to AT&T 20c498
  91. W30c516      44pin          "ZoomDAC"
  92.  
  93. Inmos:
  94. IMSG171
  95. IMSG173
  96. IMSG174
  97. IMSG176      6bit DAC
  98. IMSG178
  99.  
  100. MUSIC:
  101. MU9C1710     6 bit DAC
  102. MU9C4870     15/16 bit      Similar to Sierra "Mark 3".
  103. MU9C1880     15/16/24bit    Same as SS24
  104. MU9C4910     15/16/24bit
  105. MU9C9910     15/16/24bit    As 4910, but with dual clock generator onchip
  106. MU9C9750     6bit DAC       with onchip clock generator w/powerdown
  107. MU9C9760     6bit DAC       with onchip clock generator
  108. MU9C4160     15/16/24bit    16bit wide pixelbus
  109. MU9C9160     15/16/24bit    As 4160, but with onchip clock generator
  110.  
  111. OAK:
  112. OTI66        6bit DAC
  113. OTI66HC      15/16bit       Similar to Sierra "Mark 3"
  114.  
  115. S3:
  116. 86c716 (SDAC)       Combined RAMDAC & Clockchip. Same as ICS 5300
  117. 86c708 (GenDAC)     Combined RAMDAC & Clockchip. Same as ICS 5342
  118.  
  119. Samsung:
  120. KDA476       6bit DAC       Standard '476
  121.  
  122.  
  123. SGS-Thompson:
  124. STG1700      24bit          16bit pixel path.
  125. STG1702      24bit  44pin   As 1700 + Supports "2 24bit pixels/3 VCLKs"
  126. STG1703      24bit  68pin   As 1702 + onchip Clock Generator
  127.  
  128. Sierra Semiconductors:
  129. Sierra  "Mark1":       Only works if the VGA controller can send a byte on
  130.                        both the rising AND falling edge of the dot clock.
  131. SC11481      15-bit.        6-bit DAC.   Overlay.
  132. SC11486      15-bit.        6-bit DAC.
  133. SC11488      15 bit.        6/8 bit DAC. Overlay.
  134.  
  135. Sierra  "Mark2":
  136. SC11482      15-bit.        6-bit DAC.   Overlay.
  137. SC11483      15-bit.        6-bit DAC.
  138. SC11484      15-bit.        6/8 bit DAC. Overlay.
  139.  
  140. Sierra  "Mark3":
  141. SC11485      15/16 bit.     6-bit DAC.   Overlay.
  142. SC11487      15/16 bit.     6-bit DAC.
  143. SC11489      15/16 bit.     6/8 bit DAC. Overlay.
  144.  
  145. SC15020      24bit          16bit pixel path
  146. SC15021      24bit          16bit pixel path
  147. SC15025      24 bit.
  148. SC15026      24 bit.
  149.  
  150.  
  151. TI:
  152. TLC34058     8bit           upto 135MHz. Not VGA compatible
  153. TLC34075     24bit          upto 135MHz
  154. TVP3010      24bit          As 302x, but 32bit pixel path
  155. TVP3020      24bit          64bit pixel path
  156. TVP3025      24bit          As 3020 + Programmable Clock
  157.  
  158. Trident:
  159. TKD8001      24bit
  160.  
  161. UMC:
  162. UM70c171     Standard 6bit DAC
  163. UM70c178     15/16 bit      Similar to Sierra "Mark 3"
  164. UM70c188     24bit
  165.  
  166. Winbond:
  167. W82c476      6bit DAC       Standard '476
  168. W82c478      6/8bit DAC     Standard '478
  169. W82c490      15/16/24bit    Very close to the AT&T20c492
  170.  
  171.  
  172. 15-bit modes have 5 bits of each basic color:
  173. bit  0- 4 blue.
  174.      5- 9 green.
  175.     10-14 red.
  176. The pixel is stored in two bytes in Intel style (little endian).
  177.  
  178. 16-bit modes have 5 bits of red and blue, and 6 bits of green:
  179. bits 0- 4  blue.
  180.      5-10  green.
  181.     11-15  red.
  182. The pixel is stored in two bytes in Intel style (little endian).
  183.  
  184. 24-bit modes have 8 bits of each basic color:
  185. bits 0- 7  blue.
  186.      8-15  green
  187.     16=23  red.
  188. The pixel is stored in three bytes in Intel style (little endian).
  189.  
  190.  
  191.  
  192. The DACs are addressed on port 3C6h-3C9h. Advanced DACs have 1 or 2 extra
  193. address lines (RS2 and RS3). These may be controlled from high address bits
  194. (A10-A15) (Compaq or Weitek cards) or from registers (S3, ATI....).
  195. In the following the DAC registers are named REGxx as follows:
  196.  
  197.             I/O:     RS2:     RS3:
  198. REG00       3C8h      0        0
  199. REG01       3C9h      0        0
  200. REG02       3C6h      0        0
  201. REG03       3C7h      0        0
  202. REG04       3C8h      1        0
  203. REG05       3C9h      1        0
  204. REG06       3C6h      1        0
  205. REG07       3C7h      1        0
  206. REG08       3C8h      0        1
  207. REG09       3C9h      0        1
  208. REG0A       3C6h      0        1
  209. REG0B       3C7h      0        1
  210. REG0C       3C8h      1        1
  211. REG0D       3C9h      1        1
  212. REG0E       3C6h      1        1
  213. REG0F       3C7h      1        1
  214.  
  215.  
  216.  
  217. Many of these DACs can access REG06 using only the 4 standard DAC addresses
  218. (3C6h-3C9h) by reading 3C6h 4 or 5 times, then REG06 can be accessed at 3C6h.
  219.  
  220.   Type:
  221.  
  222.   "1r/w"   Read 3C6h 4 times, then the next read or write of 3C6h will access
  223.            the command register.
  224.  
  225.  
  226. Forcing HiColor DACs into command mode:
  227. Note: This works on the Sierra, ATT, Winbond DACs and clones, not on the
  228.  Brooktree or TI DACs, also the MUSIC DACs will require an extra read of 3C6h.
  229.  
  230. procedure dactocomm;   {switches DAC to command register}
  231. var x:word;
  232. begin
  233.   x:=inp($3C8);    {clear old state}
  234.   x:=inp($3C6);
  235.   x:=inp($3C6);
  236.   x:=inp($3C6);    {Read $3C6 4 times.}
  237.   x:=inp($3C6);
  238. end;
  239.  
  240. Now reads and writes to $3C6 will access the command register. Depending on
  241. the DAC type you may have multiple read/writes, one write/multiple reads or
  242. one read/write of the command register before it switches back to the PEL
  243. register. Any access to $3C7-$3C9 will switch back to the PEL mask register.
  244.  
  245.  
  246. Forcing HiColor DACs into normal mode:
  247.  
  248. procedure dactopel;  {switches DAC back to normal mode}
  249. var x:word;
  250. begin
  251.   x:=inp($3C8);
  252. end;
  253.  
  254.  
  255.  
  256.  
  257. HiColor DACs:     (Sierra SC1148x, MUSIC MU9C4870, OAK OTI66HC, UMC UM70C178)
  258.  
  259. REG04 (R/W):  Overlay RAM Write Address               (SC11481/2/4/5/8/9 only)
  260. bit 0-3  Write index for the Overlay registers.
  261.  
  262. REG05 (R/W):  Overlay RAM                             (SC11481/2/4/5/8/9 only)
  263. bit 0-5  Data port for the overlay registers. Works like the PEL data register
  264.          (3C9h) except that the overlay registers are accessed and the Overlay
  265.          Address registers are used for indexes.
  266. Note: on the SC11484/8/9 the Color Look-up Table and the overlay registers are
  267.       24bits wide (rather than 18bits) if the 8/6 pin is high.
  268.  
  269. REG06 (R/W):  Command Register
  270. bit   0  (SC11487) (R) Set if bits 5-7 is 1 or 3, clear otherwise
  271.     3-4  (SC11487) Accesses bits 3-4 of the PEL Mask registers (REG02)
  272.       5  (not SC11481/6/8)
  273.          If set two pixel clocks are used to latch the two bytes
  274.          needed for each pixel. Low byte is latched first.
  275.          If clear the low byte is latched on the rising edge of the
  276.          pixel clock and the high byte is latched on the falling edge.
  277.          Only some VGA chips (ET4000 and C&T655x0) can handle this.
  278.       6  (SC11485/7/9, OTI66HC, UM70C178) Set in 16bit (64k) modes (Only valid
  279.            if bit 7 set). On the SC11482/3/4 this bit is read/writable, but
  280.            has no function. On the SC11481/6/8 this bit does not exist.
  281.       7  Set in HiColor (32k/64k) modes, clear in palette modes.
  282. Note:  This register can also be accessed at 3C6h by reading 3C6h four times,
  283.        then all accesses to 3C6h will go the this register until one of the
  284.        registers 3C7h, 3C8h or 3C9h is accessed.
  285.  
  286. REG07 (R/W):  Overlay RAM Read Address              (SC11481/2/4/5/8/9 only)
  287. bit 0-3  Read index for the Overlay registers.
  288.  
  289.  
  290.  
  291. Analog Devices ADV7160,ADV7162 True-Color Video RAM-DAC:
  292. The ADV716x DACs are not really VGA compatible, but with proper initialisation
  293. palette writing and the PEL register can be simulated.
  294. REG00 W(R/W):  Address Register
  295. bit 0-10  Controls the index read or written at REG01 or REG02.
  296.           Regardless of the bus width this register is accessed by two 8bit
  297.           reads or writes at this address, low byte first.
  298.  
  299. REG01
  300.  
  301.  
  302. REG02 Control Registers
  303. REG02 index 3 (R):  ID Register
  304. bit  0-7  76h for the ADV7160, 79h for the ADV7162
  305.  
  306. REG02 index 4 (R/W):  Pixel Mask Register
  307. bit  0-7  The pixel inputs (R, G and B) are anded with this value. Set to FFh
  308.           for normal operation.
  309.  
  310. REG02 index 5 (R/W):  Command Register 1
  311. bit    0  Calibration Control. If set the LOADIN/LOADOUT synchronization
  312.           circuit is calibrated on every vertical sync (REG03 bit 5 must be 0)
  313.        1  Test Mode Control. Enable test mode if set
  314.        2  Should be set to 0
  315.        3  Hi-Byte Control. If set the high byte of the Address Register
  316.           (REG00) is accessible, if clear it is not (ADV7150 compatible).
  317.      4-5  PS Function Control. Controls how the PS0/1 inputs are used.
  318.            0: Palette Select Mode. The PS0/1 inputs selects between 4 devices
  319.           by comparing with REG03 bits 6-7 on a pixel by pixel base,
  320.            1: (ADV7160) Bypass Mode. PS1 switches between Palette Mode and
  321.           Bypass Mode on a pixel by pixel basis. Bits 6-7 controls the Bypass
  322.           Mode. Bypass mode should not be selected in Command Register 2
  323.           (REG02 index 6) and by this field at the same time, 2: Overlay Mode.
  324.           PS0/1 select one of the three overlay colors (PS0/1 = 0 for pixel
  325.           data), 3: Ignore PS Inputs. The PS0/1 inputs are completely ignored.
  326.      6-7  Bypass Color Mode Control. Controls the bypass mode switching.
  327.            0: 15bit bypass, 1: 16bit bypass, 2: 24bit bypass
  328.  
  329. REG02 index 6 (R/W):  Command Register 2
  330. bit  0-1  Should be set to 0
  331.        2  /SYNC Recognition on Green. If set the /SYNC input is encoded on the
  332.           IOG output.
  333.        3  Pedestal Enable Control. Set for a 7.5 IRE blanking pedestal, clear
  334.           for a 0 IRE pedestal.
  335.      4-7  True-Color/Bypass/Pseudo-Color Mode Control. 0: 8bit Pseudo Color
  336.           on R0-7, 4: 8bit Pseudo Color on G0-7, 8: 8bit Pseudo Color on B0-7,
  337.            9: 16bit Bypass Mode on G0-7 + R0-7, 10: 15bit Bypass Mode on G0-7
  338.            + R0-6, 11: 16bit True Color Mode on G0-7 + R0-7, 12: 15bit True
  339.           Color Mode on B3-7 + G3-7 + R3-7, 13: 15bit True Color Mode on G0-7
  340.            + R0-6, 14: 24bit True Color Mode, 15: 16bit Bypass Mode
  341.  
  342. REG02 index 7 (R/W):  Command Register 3
  343. bit  0-1  PROGCKOUT Frequency Control. Determines the PROGCKOUT output clock
  344.           frequency relative to the pixel clock (CLOCK). 0: CLOCK/4,
  345.            1: CLOCK/8, 2: CLOCK/16, 3: CLOCK/32
  346.      2-4  /BLANK Pipeline Delay Control. Controls the delay of the /BLANK
  347.           signal (in addition to the overall device pipeline delay Tpd).
  348.           Adds N * LOADOUT to the /BLANK delay.
  349.        5  Should be set to 0
  350.      6-7  Pixel Multiplex Control. 0: 1:1 MUXING - LOADOUT = CLOCK, 1: 2:1
  351.           MUXING - LOADOUT = CLOCK/2, 2: 8:1 MUXING - LOADOUT = CLOCK/8
  352.           (Pseudo Color Mode only), 3: 4:1 MUXING - LOADOUT = CLOCK/4,
  353.  
  354. REG02 index 8 (R/W):  Command Register 4
  355. bit    0  HDTV Sync Control. If set the /TRISYNC input is encoded enabling a
  356.           Tri-Level Sync output.
  357.        1  /SYNC Recognition Control on Red. If set the /SYNC input is encoded
  358.           on the IOR output.
  359.        2  /SYNC Recognition Control on Blue. If set the /SYNC input is encoded
  360.           on the IOB output.
  361.      3-4  Gain Control. Selects the Video Standard used.
  362.           Value: DAC Gain: Video Standard            Black to White current:
  363.             0      3996    RS343A, Sync & Pedestal       660mV  17.62mA
  364.             1      4224    RS343A, Sync, No Pedestal     699mV  18.63mA
  365.             2      4311    RS343A, No Sync, No Pedestal  714mV  19.05mA
  366.             3      5592    RS170,  Sync & Pedestal       925mV  24.67mA
  367.        5  Signature Clock Control. Enables the Signature Analyser if set
  368.        6  Signature Reset. To reset the Signature Analyser write 0, then 1
  369.           to this field.
  370.        7  Signature Acquire. Enables Signature Acquisition if set
  371.  
  372. REG02 index 9 (R/W):  PLL Command Register
  373. bit    0  PLL Control. Enables the PLL if set
  374.        1  RSEL Bit Control. When set the PLL Reference Divider is in units of
  375.            2, if clear in units of 1. See REG02 index 0Ch for details.
  376.        2  VSEL Bit Control. When set the PLL Feedback Divider is in units of
  377.            2, if clear in units of 1. See REG02 index 0Fh for details.
  378.        3  Should be set to 0
  379.      4-5  Output Divide Control. Selects the Post divider for the VCO
  380.            0: VCO/1, 1: VCO/2, 2: VCO/4, 3: VCO/8
  381.      6-7  PLL S Control. The lower two bits of the PLL Feedback value.
  382.           See REG02 index 0Fh for details.
  383.  
  384. REG02 index 0Ah (R):  Status Register
  385. bit    0  Set if either of the IOR,IOG or IOB outputs exceeds the internal
  386.           voltage of the /SENSE comparator circuit
  387.  
  388. REG02 index 0Bh (R):  Revision Register
  389. bit  0-?  Silicon Revision Code.
  390.  
  391. REG02 index 0Ch (R/W):  PLL R Register
  392. bit  0-6  Controls the PLL Reference Divider value together with the RSEL bit
  393.           (index 9 bit 1). If this field is set to 0 the PLL stops.
  394.           The effective value is: (1+RSEL)*(This_Field+2).
  395.           This allows all values from 3-129 and all even values from 130-258.
  396.  
  397. REG02 index 0Dh (R/W):  Command Register 5
  398. bit  0-5  Should be set to 0
  399.        6  Set to enable the internal PLL, clear to disable it
  400.        7  Should be set to 0
  401.  
  402. REG02 index 0Fh (R/W):  PLL V Register
  403. bit  0-6  Controls the PLL Feedback Divider value together with the VSEL bit
  404.           (index 9 bit 2). If this field is set to 0 the PLL stops.
  405.           The effective value is: (1+VSEL)*(4*(This_Field+2)+ S)
  406.           where S is the value from REG02 index 0Ch bits 6-7.
  407.           This allows all values from 12-519 and all even values from 520-1038
  408.  
  409. REG02 index 10h (R):  Signature Red Register
  410. REG02 index 11h (R):  Signature Blue Register
  411. REG02 index 12h (R):  Signature Green Register
  412. REG02 index 13h (R):  Signature Misc Register
  413.  
  414. REG02 index 200h W(R/W):  Cursor X Register
  415. bit 0-15  The X coordinate of the cursor as a 2's complement (-4096 to 4095).
  416. Note: Low byte in index 200h, High byte in index 201h
  417. Note: When accessing the cursor X/Y registers (index 200h to 203h) the index
  418.       register autoincrements with each access. These registers must be
  419.       updated in the order 200h,201h,202h and then 203h
  420.  
  421. REG02 index 202h W(R/W):  Cursor Y Register
  422. bit 0-15  The Y coordinate of the cursor as a 2's complement (-4096 to 4095).
  423. Note: Low byte in index 202h, High byte in index 203h
  424. Note: When accessing the cursor X/Y registers (index 200h to 203h) the index
  425.       register autoincrements with each access. These registers must be
  426.       updated in the order 200h,201h,202h and then 203h
  427.  
  428. REG02 index 204h (R/W):  Cursor Control Register
  429. bit  0-1  Cursor Mode Control. 1: X11 cursor, 2: XGA cursor
  430.           Pattern:    X11 cursor:        XGA cursor:
  431.              0        Transparent        Color 1
  432.              1        Transparent        Color 2
  433.              2        Color 1            Transparent
  434.              3        Color 2            Bit-Wise Complement (XOR cursor)
  435.        2  Cursor Enable. Enables the cursor if set
  436.        3  Interlace Control. Set for interlaced modes.
  437.      4-7  Should be set to 0
  438.  
  439. REG02 index 303h (R/W):  Color 2
  440.  
  441.  
  442. REG02 index 304h (R/W):  Color 1
  443.  
  444. REG02 index 400h-7FFh (R/W):  Cursor Image
  445. bit  0-7  The 64x64 cursor image is stored in these 1024 bytes with 4 2bit
  446.           "pixels" per index. Index 400h holds the 4 leftmost pixels of the
  447.           first (topmost) line, index 40Fh the 4 rightmost and index 7FFh the
  448.           4 rightmost pixels of the last line.
  449.  
  450. REG02 index 0-2, 0Eh, 14h and 15h are labeled as "Test Registers"
  451.  
  452. REG03 (R/W):  Mode Register
  453. bit    0  Reset Control. To reset the pixel port sampling sequence to start
  454.           with port A, write 1, then 0 and finally 1 to this bit.
  455.        1  RAM-DAC Resolution Control. If set the LUT and DACs are 10bits, if
  456.           clear LUT and DACs are 8bits (lower 2 inputs to the 10bit DACs are
  457.           forced to 0).
  458.        2  MPU Data Bus Width. If set the MPU interface is 10 bits wide
  459.      3-4  Operational Mode Control. 0 for normal operation
  460.        5  Calibrate LOADIN. To calibrate the LOADIN/LOADOUT synchronization
  461.           circuit write 0, then 1 to this bit. Should be 0 for normal
  462.           operation.
  463.      6-7  Palette Select Match Bits Control. If Command Register 1 (REG02
  464.           index 5) bits 4-5 is 0 the PS0-1 bits are compared with these two
  465.           bits on a pixel per pixel base allowing realtime switching between
  466.           up to 4 devices
  467.  
  468.  
  469.  
  470.  
  471. ATI 68860/68880 Truecolor DACs:
  472. REG08 (R/W):
  473. bit 0-?  Always 2 ??
  474.  
  475. REG0A (R/W):
  476. bit 0-?  Always 1Dh ??
  477.  
  478. REG0B (R/W):  (GMR ?)
  479. bit 0-7  Mode. 82h: 4bpp, 83h: 8bpp, A0h: 15bpp, A1h: 16bpp, C0h: 24bpp,
  480.           E3h: 32bpp  (80h for VGA modes ?)
  481.  
  482. REG0C (R/W):  Device Setup Register A
  483. bit   0  Controls 6/8bit DAC. 0: 8bit DAC/LUT, 1: 6bit DAC/LUT
  484.     2-3  Depends on Video memory (= VRAM width ?) . 1: Less than 1Mb, 2: 1Mb,
  485.            3: > 1Mb
  486.     5-6  Always set ?
  487.       7  If set can remove "snow" in some cases (A860_Delay_L ?) ??
  488.  
  489.  
  490.  
  491.  
  492. AT&T 20c49x,Winbond W82c490 Truecolor DACs:
  493.  
  494. REG06 (R/W):  Command Register
  495. bit   0  (W82c490, some ATTs) Power Down Enable. If set the DACs and video
  496.           multiplexers are powered down. The CPU interface is still working.
  497.       1  (490,491) In mode 0 this bit when set selects 8bit DACs, when clear
  498.             6bit DACs.
  499.     2-4  Exists, but appears to have no function ?
  500.     5-7  Mode:  0-3: Palette, 4: 15bit (32k) the two bytes are latched on
  501.          opposite edges of the dotclock (similar to SC11486), 5: 15bit (32k),
  502.            6: 16bit (64k), 7: 24bit (16m)
  503. Note: This register can also be accessed by reading REG02 4 times, then the
  504.       next read or write of REG02 will access this register. Any access of
  505.       REG00, REG01 or REG03 will terminate the access to this register. The
  506.       register can only be read or written once before the DAC is returned to
  507.       normal mode (DAC type 4-1r1w).
  508.  
  509.  
  510.  
  511.  
  512. AT&T 20c498,21c498,22c498 Truecolor DACs (Also IC Works?):
  513. REG06 (R/W):  Command Register
  514. bit 0,2  (22c498) Clockmode for Mode 2 (2 8bit pixels/VCLK). 0: Clock < 22.5
  515.             MHz, 1: Clock < 45 MHz, 2: Clock >= 45 MHz
  516.       1  In palette modes this bit when set selects 8bit DACs, when clear 6bit
  517.          DACs.
  518.     4-7  Mode: 0: 8bit 1VCLK/pixel, 1: 15bit 1VCLK/pixel, 2: 8bit (2 pixels/
  519.           VCLK), 3: 16bit 1VCLK/pixel, 5: 24/32bit 2VCLKs/pixel, 6: 16bit
  520.           2VCLKs/pixel
  521. Note:  This register can also be accessed at REG02 by reading REG02 four times,
  522.        The fifth read will access of 3C6h will access this register. Only one
  523.        read or write will be allowed (DAC type 4-1r1w2i), the 6th read returns
  524.        84h and the 7th returns 98h (don't know about the 20c498).
  525.  
  526.  
  527.  
  528.  
  529. Avance Logic ALG1201 Truecolor DAC:
  530. REG06 (R/W):  "Hidden Command register"
  531. bit 5-7  Mode. 5: 15bit, 6: 16bit, 7: 24bit
  532. Note: This register can also be accessed by reading REG02 4 times, then the
  533.       next read or write of REG02 will access this register. Any access of
  534.       REG00, REG01 or REG03 will terminate the access to this register. The
  535.       register can only be read or written once before the DAC is returned to
  536.       normal mode (DAC type 4-1r1w).
  537.  
  538.  
  539.  
  540.  
  541. BrookTree Bt477:
  542. REG06 (R/W):
  543. bit   0  DAC powerdown. If set the DAC powers down
  544.       1  DAC Width. If set the DAC and palette registers are 8bit wide, if
  545.           clear only 6bit wide (as std VGA).
  546.       5  IRE control ?? seems to affect the output intensity ?
  547.  
  548.  
  549.  
  550.  
  551. BrookTree Bt481/482:
  552.  
  553. REG00 index 0 (R/W):  Ind Pixel Mask
  554.  
  555. REG00 index 1 (R/W):  Overlay Mask
  556.  
  557. REG00 index 2 (R/W):  Command Register B
  558. bit    0  Set to power down the DAC (Sleep mode).
  559.        1  DAC Width. If set the DAC and palette registers are 8bit wide, if
  560.           clear only 6bit wide (as std VGA).
  561.        2  Sync on Red if set
  562.        3  Sync on Green if set
  563.        4  Sync on Blue if set
  564.        5  Set for 7.5 IRE, clear for 0.0 IRE pedestal (affects DAC range).
  565.        6  Enables the Overlay registers if set
  566.  
  567. REG00 index 3 (R/W):  Cursor Register                                    (482)
  568. bit  0-1  Cursor type. 0: disabled, 1: 3-color, 2: Windows, 3: X11 style
  569.        2  Cursor Op disabled if set?
  570.        3  If clear reads/writes to REG04,REG05,REG07 will access the cursor
  571.           palette, if set the cursor pattern data will be accessed instead.
  572.        4  Set in interlaced modes
  573.        5  Selects External cursor if set
  574.  
  575. REG00 index 4 W(R/W):  Cursor X                                          (482)
  576. bit 0-11  Cursor X position
  577.  
  578. REG00 index 6 W(R/W):  Cursor Y                                          (482)
  579. bit 0-11  Cursor Y position
  580. Note: the indexed DAC registers are accessed by setting bit 0 of REG06. Then
  581.       REG00 is the index register and REG02 is the data register.
  582.  
  583. REG04 (R/W):  Cursor Write Address                                       (482)
  584. bit 0-1?  Selects the palette register which will be written at REG05
  585.             0: Overscan, 1: Cursor Background, 2: Cursor Foreground
  586.  
  587. REG05 (R/W):  Cursor RAM Data                                            (482)
  588. bit  0-7  Cursor palette data
  589. Note: If REG00 index 3 bit 3 is clear this works like the palette address&data
  590.       registers at REG00,REG01®03 except that a separate palette is
  591.       accessed. Each read/write of this register will increment first through
  592.       the red,green,blue sequence and then the Address register (REG04/REG07).
  593.       If REG00 index 3 bit 3 is set REG04/REG07 are the lower 8 bits of the
  594.       index into the 1024 byte palette pattern RAM, which will increment for
  595.       each access to this register.
  596.  
  597. REG06 (R/W):  Command Register A
  598. bit    0  If set the Bt481/2 indexed DAC registers can be accessed by setting
  599.           REG00 to the index and reading or writing the data at REG02.
  600.      4-7  Mode. 0: Palette, 8: 15bit (Dual edge), 9: 24bit (Dual edge),
  601.             Ah: 15bit (32K), Ch: 16bit (Dual edge), Eh: 16bit (64K),
  602.             Fh: 24bit (16m). The Dual edge modes transfers data on both the
  603.           rising and falling edges of the pixel clock.
  604. Note:  This register can also be accessed at REG02 by reading REG02 four
  605.        times. Then the command register can be read or written at REG02.
  606.        This access will be terminated by any access to REG00, REG01 or REG03
  607.        or after a write to the command register (DAC type 4-Nr1w).
  608.  
  609. REG07 (R/W):  Cursor Read Address                                        (482)
  610. bit 0-1?  Selects the palette register which will be read at REG05
  611.  
  612.  
  613.  
  614.  
  615. BrookTree Bt484, Bt485, AT&T 20c504/5 Truecolor DACs:
  616. The 485 and 505 has the extra register at REG0A and supports 64x64 cursor
  617. The 484 & 504 appears to be limited to 110MHz, the 485/505 to 135MHz
  618.  
  619. REG04 (R/W):  Cursor/Overscan Write Address
  620. bit 0-7  The PEL data register (0..255) to be written to REG05.
  621. Note: After writing the 3 bytes at REG05 this register will increment, pointing
  622.       to the next data register.
  623.  
  624. REG05 (R/W):  Cursor/Overscan Data
  625. bit 0-5  Color value
  626. Note:  Each read or write of this register will cycle through first the
  627.        registers for Red, Blue and Green, then increment the appropriate
  628.        address register.
  629. Note: the registers REG04,REG05,REG07 works like the normal REG00,REG01,REG03
  630.       registers, except that a separate set of palette registers (16 overlay
  631.       registers ?) are being accessed.
  632.       Index 00h  Overscan color
  633.             01h  Cursor Color 1 (Background)
  634.             02h  Cursor Color 2 (Foreground)
  635.             03h  Cursor Color 3
  636. Note: if the DAC is in 6bit mode (REG06 bit 1 is 0) the 2 upper bits of the
  637.       cursor colors are ignored.
  638.  
  639. REG06 (R/W):  Command Reg 0
  640. bit   0  Power Down. If set the DACs and RAM power is turned off, but the RAM
  641.          still retains data, if clear the RAMDAC is operating normally
  642.       1  Set if DAC and palette registers are 8bit DACs, clear if 6bit.
  643.       2  Sync on Red if set
  644.       3  Sync on Green if set
  645.       4  Sync on Blue if set
  646.       5  Set for 7.5 IRE pedestal, clear for 0.0 IRE.
  647.       6  Disables internal clocking if set
  648.       7  (485,505) Enable CR3. If clear the Status register is present at
  649.           REG0A, if set 3C8h determines which register is present at REG0A:
  650.             00h    Status Register
  651.             01h    Command Register 3
  652.  
  653. REG07 (R/W):  Cursor/Overscan Read Address
  654. bit 0-7  The PEL data register (0..255) to be read from REG05.
  655. Note: After reading the 3 bytes at REG05 this register will increment,
  656.       pointing to the next data register.
  657.  
  658. REG08 (R/W):  Command Reg 1
  659. bit    0  In 15/16bit 1:1 mode selects the pixel port (A-B or C-D) to take
  660.           pixel data from. Clear for A-B, set for C-D. See bit 1.
  661.        1  PORTSEL. In 15bit 1:1 mode (bit 2 set & bit 3 clear), this bit if
  662.           set causes pin P7D (most significant bit of the C-D port) to select
  663.           whether the 15bit pixel data is taken from port A-B or port C-D,
  664.           thus allowing real-time switching between video sources.
  665.        2  SPARSE. Set if 16bit data is 1:1, clear if it is muxed 2:1
  666.        3  Set in 5/6/5 mode, clear in all other modes
  667.        4  If set decodes True-color pixel data (5/5/5, 5/6/5 or 8/8/8 mode),
  668.           directly, if clear each component (R-G-B) of the pixel data is used
  669.           is used as a separate index to the palette RAM for the specific RGB
  670.           component, allowing non-linear scales (gamma correction) for each
  671.           color-component. REG09 bit 2 controls the indexing.
  672.      5-6  Bits per pixel. 0: 24, 1: 15/16, 2: 8, 3: 4
  673.  
  674. REG09 (R/W):  Command Reg 2
  675. bit  0-1  Cursor mode. 0: Disabled, 1: 3-Color, 2: Windows, 3: X11 Style
  676.        2  Sparse or Contigous Indexing. In Look-up True-color modes (REG08 bit
  677.           4 clear) selects whether each color component is shifted right or
  678.           left before being used as an index to the palette. If set the pixel
  679.           data is treated as the least significant bits of the index
  680.           (Contigous index), if clear as the most significanty bits (Sparse
  681.           index).
  682.        3  Set in interlaced modes (used for the cursor).
  683.        4  Selects input clock. 0: PCLK0, 1: PCLK1
  684.        5  If clear the dac takes data from the VGA port and each byte is a one
  685.           byte palette index regardless of the state in Command Register 1, if
  686.           set pixel data is taken from pixel ports A-D and data format is
  687.           controlled by Command Register 1
  688.        6  Test Path enabled if set.
  689.        7  SCLK (Video shift clock) disabled if set.
  690.  
  691. REG0A (R):  Status Reg
  692. bit 4-7  Product ID ?
  693.            4: AT&T20c504, 0Dh: AT&T20c505, 8-Bh: Bt484/5
  694. Note: The two registers at REG0A are selected by bit 7 of REG06.
  695.  
  696. REG0A (R/W):  Command Reg 3                                   (485,505 only)
  697. Bit  0-1  Bits 8-9 of the Palette Write Address (3C8h)
  698.        2  Set if using 64x64 cursor, clear if 32x32 cursor.
  699.        3  If set the Clock Doubler is enabled and the input clock is doubled.
  700. Note: The two registers at REG0A are selected by bit 7 of REG06.
  701.       This register does not exist on the Bt484
  702.  
  703. REG0B (R/W):  Cursor Ram Data
  704. bit  0-7  Data port for the Hardware Cursor Map.
  705.           There are either 2 128byte (32x32bit) or 2 512 byte (64x64bit) maps
  706.           depending on REG0A bit 2. The first is the cursor image and the
  707.           second is the cursor shape.
  708.           To update the cursor map, write the start address to REG00and start
  709.           writing to this register. The index will increment for each byte.
  710.  
  711. REG0C W(R/W):  Hardware Cursor X-position
  712. bit 0-11  The X-position of the rightmost pixel of the hardware cursor
  713.  
  714. REG0E  W(R/W):  Hardware Cursor Y-position
  715. bit 0-11  The Y-position of the lower scanline of the hardware cursor
  716.  
  717.  
  718.  
  719.  
  720. Chrontel CH8391 and CH8398:
  721. REG04 (R/W):  Clock RAM Write Address
  722. bit  0-?  Selects the register that is writable at REG05. The first write
  723.           accesses the low byte of the register and the second the high byte.
  724. Note: Reading this register 4 times will cause the next access of this
  725.       register to go to the "Hidden Clock" register.
  726.  
  727. REG04 (R/W):  Clock Select Register
  728. bit  0-3  Selects the Video Clock.
  729.      4-6  Selects the Memory Clock
  730.        7  Frequency hold. If set the video and memory clock selects in bits
  731.            0-6 are ORed with the actual inputs from the clock select pins
  732. Note: This register is accessed6 by reading REG04 4 timers first.
  733.  
  734. REG05 (R/W):  Clock RAM Data Register
  735. Note: each indexed register addressed here is 16bit wide and thus must be
  736.       read/written as two bytes, low byte first.
  737.  
  738. REG05 index 00h-0Fh W(R/W):  Video Clock Select 0-15
  739. bit  0-7  N. Numerator. Effective value (n) is N+8. The following N values
  740.            may give unstable output: 0-7, 10-15, 19-23, 28-31, 37-39, 46-47
  741.            and 55.
  742.     8-13  M. Denominator. Effective value (m) is M+2. It is recommended to
  743.            use N<11 for best clock performance
  744.    14-15  K. Clock Divider. Effective divider (k) is: 0: 1, 1: 2, 2: 4, 3: 8
  745. The resulting clock is: ref*n/(m*k) where ref is the reference clock, usually
  746.  14.31818MHz and n,m and k are the effective (as opposed to coded) factors
  747. Note: The CH8398 apparently has Video Clock 0 hardcoded as 25.175MHz and
  748.       Video Clock 1 hardcoded as 28.322. The CH8391 does not.
  749.  
  750. REG05 index 10h-17h W(R/W):  Memory Clock Select 0-7
  751. Probably same coding as the Video Clocks.
  752.  
  753. REG06 (R/W):  Control Register (CH8391)
  754. bit    0  Power Down if set
  755.        1  If set the DAC and palette registers are 8bit wide (256 colors of
  756.            16Mcolors), if clear 6bit (256 colors of 256K colors)
  757.      5-7  Color mode. 0: Palette, 5: 15bit, 6: 16bit, 7: 24bit
  758. Note: This register can also be accessed by reading 3C6h 4 times in a row.
  759.       The 4th read will return the chip ID (B3h for the CH8391) and the 5th
  760.       read or write will access this register ("1r/w" type Cmd register).
  761.  
  762. REG06 (R/W):  Control Register (CH8398)
  763. bit    0  Power Down if set
  764.        2  Always set ??
  765.      4-7  Color mode. 0: Palette, 1: 15bit, 3: 16bit, 5: 24bit, 6: 16bit,
  766.            7: 24bit, 11: 24bit, 12: 15bit
  767. Note: This register can also be accessed by reading 3C6h 4 times in a row.
  768.       The 4th read will return the chip ID (C0h for the CH8398) and the 5th
  769.       read or write will access this register ("1r/w" type Cmd register).
  770.  
  771. REG07 (R/W):  Clock RAM Read Address
  772. bit  0-?  Selects the register that is readable at REG05. The first read
  773.           accesses the low byte of the register and the second the high byte.
  774.  
  775.  
  776.  
  777.  
  778. Cirrus Logic 542x/3x internal DAC.
  779.  - How close is this to the Cirrus Logic CL-GD5200 & Acumos ADAC1 ?
  780. REG02 (R/W):  Hidden DAC Register
  781. bit  0-3  Extended Mode Select. If bit 6 and 7 are both set this field
  782.           selects the DAC mode:
  783.               0:  5-5-5 15bit Sierra HiColor
  784.               1:  5-6-5 16bit "XGA" HiColor
  785.               5:  (5422+) 8-8-8 24bit TrueColor. This mode also exists on the
  786.                     5420 rev1, but is not documented.
  787.             6/7:  (5428+) DAC Power-down
  788.               8:  (5428+) 8bit Greyscale.
  789.               9:  (5428+) 3-3-2 8bit RGB
  790.        4  32K Color Control. If set bit 15 (MSB) of a 15bit pixel selects
  791.           whether the pixel is HiColor(bit 15 = 0) or palette data(bit 15 = 1,
  792.           bit 0-7 is the palette index). This bit only has effect in 5-5-5
  793.           15bit modes.
  794.        5  Clocking Mode. If set Clocking Mode 2 will be selected and data will
  795.           only be latched on the rising edge of DCLK, if clear Clocking Mode 1
  796.           will be selected and data will be latched on both the rising edge
  797.           (low byte) and falling edge (high byte) of DCLK. This bit only has
  798.           effect in 15/16 bit modes as all other modes will use Clocking Mode
  799.           2. Clocking Mode 1 should only be used for externally supplied DCLK
  800.           and pixel data.
  801.        6  Enable ALL Extended Modes. If bit 7 is set and this bit is clear the
  802.           DAC is in 5-5-5 15bit Sierra HiColor mode, if both bit 7 and this
  803.           bit are set bits 0-3 determines the DAC mode.
  804.        7  Enable 5-5-5 Mode. If set the DAC is in an advanced mode, depending
  805.           on the other bits in this register, if clear the DAC is in VGA
  806.           compatible palette mode.
  807. Note: This register is accessed by reading REG02 four times to unlock this
  808.       register, then the next read or write of REG02 will access this register.
  809.       After reading or writing this register the register is locked and this
  810.       register can only be accessed be redoing the 4 reads of REG02 etc. Any
  811.       access to REG00,REG01,REG03 will also lock this register. The 5428 is the
  812.       exception where reads of this register will NOT lock it.
  813. Note: When REG02 is 0FFh the access to this register described above does
  814. x      not always work.
  815. Note: This register does not exist on the 5401/5402 and the 5420 rev A.
  816.  
  817.  
  818.  
  819.  
  820. IBM RGB514, RGB524, RGB525, RGB528 Truecolor DAC w/PLL:
  821. REG04 W(R/W):  Index
  822. bit  0-?  Selects the indexed register that will be accessed by the next read
  823.           or write of REG06. If REG07 bit 0 is set this index is
  824.           autoincremented by each access of REG06.
  825.  
  826. REG06 index 00h (R):  Rev
  827. bit  0-7  Revision. F0h for the RGB524, ? for the RGB514, RGB525,RGB528
  828.  
  829. REG06 index 01h (R):  Id
  830. bit  0-7  Chip ID. 2 for the RGB524, ? for the RGB514,RGB525,RGB528
  831.  
  832. REG06 index 02h (R/W):  Misc Clock
  833. bit    0  Set for internal (PLL) clock ??
  834.        1  Set for double clock
  835.  
  836. REG06 index 03h (R/W):  Sync
  837. REG06 index 04h (R/W):  Hsync Pos
  838. bit  0-3  Hsync Position ?
  839.  
  840. REG06 index 05h (R/W):  Power Management
  841. REG06 index 06h (R/W):  DAC Options
  842. bit    1  Fast slew if set ?
  843.        3  Sync on Green if set
  844.  
  845. REG06 index 07h (R/W):  Palette Control
  846. REG06 index 08h (R/W):  System Clock                             (Not RGB525?)
  847. REG06 index 0Ah (R/W):  Pixel Format
  848. bit  0-2  Pixel format. 3: 8bpp, 4: 15/16bpp, 6: 32bpp
  849.  
  850. REG06 index 0Bh (R/W):  8bpp
  851. REG06 index 0Ch (R/W):  16bpp
  852. bit    1  Set for 16bpp (5:6:5), clear for 15bpp (5:5:5)
  853.  
  854. REG06 index 0Dh (R/W):  24bpp
  855. REG06 index 0Eh (R/W):  32bpp
  856. REG06 index 10h (R/W):  PLL Control 1
  857. bit    0  Set to use 8 internal clocks with separate numerators, clear to
  858.           use 16 internal clocks with a common numerator (index 14h).
  859.      1-2  Set to 1 ??
  860.  
  861. REG06 index 11h (R/W):  PLL Control 2
  862. bit  0-3  Selects the PLL clock used (0-7 if index 10h bit 0 set, 0-15 if it
  863.           is clear).
  864.  
  865. REG06 index 14h (R/W):  PLL Ref Div Fix
  866. bit  0-4  N. Numerator. Guess 0 not valid. Used for f0-f15 if index 10h bit 0
  867.           is clear.
  868.  
  869. REG06 index 15h W(R/W):  Sysclk Ref/VCO Div                       (Not RGB525)
  870. bit  0-4  N. Numerator. Guess 0 not valid
  871.  
  872. REG06 index 16h (R/W):  Sysclk VCO Div                            (Not RGB525)
  873. bit  0-5  M. Multiplier. 65-128, Stored as 0-63.
  874.      6-7  DF. Divider. 0: /8, 1: /4, 2: /2, 1: /1. (Div=1,2,4,8).
  875. Note: Memory Clock. The effective clock is: Ref*(M+65)/(N*Div), where Ref is
  876.       the reference clock, typ 14.31828MHz and N the numerator from index 15h
  877.  
  878. REG06 index 20h-2Fh (R/W):  PLL Clock 0-15 (f0-f15)
  879. bit  0-5  M. Multiplier. 65-128, Stored as 0-63.
  880.      6-7  DF. Divider. 0: /8, 1: /4, 2: /2, 1: /1. (Div=1,2,4,8).
  881. Note: Only active if index 10h bit 0 is clear. The effective clock is:
  882.       Ref*(M+65)/(N*Div), where Ref is the reference clock, typ 14.31828MHz
  883.       and N is the Numerator from index 14h.
  884.  
  885. REG06 index 20h-2Eh W(R/W):  PLL Clock 0-7 (m0/n0..)
  886. bit  0-5  M. Multiplier. 65-128, Stored as 0-63.
  887.      6-7  DF. Divider. 0: /8, 1: /4, 2: /2, 1: /1. (Div=1,2,4,8).
  888.     8-12  N. Numerator. Guess 0 not valid
  889. Note: Only active if index 10h bit 0 is set. The effective clock is:
  890.       Ref*(M+65)/(N*Div), where Ref is the reference clock, typ 14.31828MHz
  891.  
  892. REG06 index 30h (R/W):  "Cursor Control"
  893. bit  0-1  Cursor type. 0: Disabled, 2: Windows?, 3: X11 cursor
  894.        2  Set for 64x64 cursor, clear for 32x32 cursor
  895.        3
  896.        5  Set for ??
  897.  
  898. REG06 index 31h W(R/W):  "Cursor X position"
  899. bit  0-?  The horizontal position of the hardware cursor
  900.  
  901. REG06 index 33h W(R/W):  "Cursor Y position"
  902. bit  0-?  The vertical position of the hardware cursor
  903.  
  904. REG06 index 35h (R/W):  Cursor Hot-Spot X
  905.  
  906. REG06 index 36h (R/W):  Cursor Hot-Spot Y
  907.  
  908. REG06 index 40h (R/W):  Cursor Color1 Red
  909. bit  0-7  Red component of the Cursor Color1.
  910.  
  911. REG06 index 41h (R/W):  Cursor Color1 Green
  912. bit  0-7  Green component of the Cursor Color1.
  913.  
  914. REG06 index 42h (R/W):  Cursor Color1 Blue
  915. bit  0-7  Blue component of the Cursor Color1.
  916.  
  917. REG06 index 43h (R/W):  Cursor Color2 Red
  918. bit  0-7  Red component of the Cursor Color2.
  919.  
  920. REG06 index 44h (R/W):  Cursor Color2 Green
  921. bit  0-7  Green component of the Cursor Color2.
  922.  
  923. REG06 index 45h (R/W):  Cursor Color2 Blue
  924. bit  0-7  Blue component of the Cursor Color2.
  925.  
  926. REG06 index 46h (R/W):  Cursor Color3 Red
  927. bit  0-7  Red component of the Cursor Color3.
  928.  
  929. REG06 index 47h (R/W):  Cursor Color3 Green
  930. bit  0-7  Green component of the Cursor Color3.
  931.  
  932. REG06 index 48h (R/W):  Cursor Color3 Blue
  933. bit  0-7  Blue component of the Cursor Color3.
  934.  
  935. REG06 index 60h (R/W):  Border Color Red
  936. bit  0-7  Red component of the Border Color.
  937.  
  938. REG06 index 61h (R/W):  Border Color Green
  939. bit  0-7  Green component of the Border Color.
  940.  
  941. REG06 index 62h (R/W):  Border Color Blue
  942. bit  0-7  Blue component of the Border Color.
  943.  
  944. REG06 index 70h (R/W):  Miscellaneous 1
  945. bit    6
  946.  
  947. REG06 index 71h (R/W):  Miscellaneous 2
  948. bit    0
  949.        2  If set DACs & LUTs are 8bit wide, if clear only 6bits wide
  950.  
  951. REG06 index 72h (R/W):  Miscellaneous 3
  952. REG06 index 73h (R/W):  Miscellaneous 4                           (Not RGB525)
  953. REG06 index 82h (R/W):  DAC Sense
  954. REG06 index 84h (R/W):  Misc Red
  955. REG06 index 86h (R/W):  Misc Green
  956. REG06 index 88h (R/W):  Misc Blue
  957. REG06 index 8Eh (R/W):  PLL VCO Div In
  958. REG06 index 8Fh (R/W):  PLL Ref Div In
  959. REG06 index 90h (R/W):  VRAM Mask 0
  960. REG06 index 91h (R/W):  VRAM Mask 1
  961. REG06 index 92h (R/W):  VRAM Mask 2
  962. REG06 index 93h (R/W):  VRAM Mask 3
  963.  
  964. REG06 index 100h-4FFh (R/W):  "Cursor Data"
  965. Note: The cursor map is either a 64x64x2 (1024 bytes) or 32x32x2 (256bytes).
  966.       The map data is stored with upper lines first, left pixels first. Each
  967.       byte holds 4 pixels, with lowest pixel in bits 0-1 and highest on 6-7.
  968.          High bit:  Low bit:    Resulting Screen data:
  969.              0         0
  970.              0         1
  971.              1         0        Screen data
  972.              1         1
  973.  
  974. REG07 (R/W):  Index Control
  975. bit   0  If set the index at REG04 is autoincremented by each access of REG06
  976.  
  977.  
  978.  
  979.  
  980. ICS 5301:
  981. REG06 (R/W):  "Hidden DAC register"
  982. bit 0-1  Power down if set ??
  983.     2-4  Always 0
  984.     5-7  Mode. 1,4,5: 15bit, 3,6: 16bit, 2,7: 24bit
  985. Note: This register can be accessed by reading REG02 4 times, then the next
  986.       read or write of REG02 will access this register. Any access of REG00,
  987.       REG01 or REG03 will terminate the access to this register. The register
  988.       can only be read or written once before the DAC is returned to normal
  989.       mode (DAC type 4-1r1w).
  990.  
  991.  
  992.  
  993.  
  994. IC Works W30c498, W30c516 Truecolor DACs:
  995. REG06 (R/W):  Command Register
  996. bit 0,2  (?) Clockmode for Mode 2 (2 8bit pixels/VCLK). 0: Clock < 22.5
  997.             MHz, 1: Clock < 45 MHz, 2: Clock >= 45 MHz
  998.       1  In palette modes this bit when set selects 8bit DACs, when clear 6bit
  999.          DACs.
  1000.     4-7  Mode: 0: 8bit 1VCLK/pixel, 1: 15bit 1VCLK/pixel, 2: 8bit (2 pixels/
  1001.           VCLK), 3: 16bit 1VCLK/pixel, 5: 32bit 2VCLKs/pixel, 6: 16bit
  1002.           2VCLKs/pixel, 10: 15bit 2VCLKs/pixel
  1003. Note:  This register can also be accessed at REG02 by reading REG02 four times
  1004.        The fifth read will access of 3C6h will access this register. Only one
  1005.        read or write will be allowed (DAC type 4-1r1w3i), the 6th read returns
  1006.        84h, the 7th returns 98h and the 8th read returns 4Fh (at least for the
  1007.        w30c516).
  1008.  
  1009.  
  1010.  
  1011.  
  1012. MUSIC MU9c1880 and Diamond SS24 Truecolor DACs:
  1013. REG06 (R/W):  Command Register
  1014. bit 0,6  Red  Byte Position Shift. In 24bit mode delays the fetching of the
  1015.          first pixel of each scanline by 1 or 2 bytes to synchronize with the
  1016.          start of the first pixel.
  1017.            0: no delay, 1: delay 1 byte, 2: delay 2 bytes
  1018.   1-3,5  Selects the Hi- or Truecolor mode. 8: 15bit (5-5-5) HiColor,
  1019.            0Bh: 16bit (5-6-5) HiColor, 7: 24bit Truecolor (Red byte first).
  1020.       4  Pixel Mode Switch. In 15bit mode when this bit is set, the most
  1021.          significant bit of each 16bit pixel whether that pixel should be
  1022.          displayed as HiColor (bit 15=0) or Pseudo Color (bit 15=1).
  1023.          If this bit clear all pixels are displayed as HiColor
  1024.          This bit should be clear in 16bit mode and set in 24bit mode.
  1025.       7  If clear the DAC is in Pseudo Color mode, all other bits in this
  1026.          register are ignored, if set it is in a Hi- or Truecolor mode (15,16
  1027.          or 24 bits/pixel).
  1028. Note:  This register can also be accessed at REG02 by reading REG02 four times,
  1029.        The fifth read will return 8Eh (the ID for the MU9c1880/SS24) and then
  1030.        the next read or write of 3C6h will access this register. Only one read
  1031.        or write will be allowed (DAC type 5i-1r1w).
  1032.  
  1033.  
  1034.  
  1035.  
  1036. MUSIC MU9c4870 High Color(?) DAC
  1037. MUSIC MU9c4910 True Color DAC.
  1038. MUSIC MU9c9910 True Color DAC & Clock Generator.
  1039. REG04 (R/W):  PLL Write Index Register                             (9910 only)
  1040. bit 0-3  Selects the index register which will be accessed by the next write
  1041.          to REG05.
  1042.  
  1043. REG05 (R/W):  PLL Data Register                                    (9910 only)
  1044. The PLL registers accessed at this register are indexed via REG04 (writes) and
  1045. REG07 (reads). All (?) are two byte registers which are accessed via two reads
  1046. or writes (low byte first) each of the indexes have an internal flip-flop to
  1047. track low/high byte. Each read of REG05 will increment the read index (with
  1048. the flip-flop incremented first). Writes increment the write index (REG04)
  1049. similarly.
  1050.  
  1051. REG05 index 00h - 07h W(R/W):  f0-f7 PLL Parameters
  1052. bit  0-6  M. Numerator.
  1053.     8-11  N1. Quotient. Prescales REF for the PLL.
  1054.    12-13  N2. Clock divider. Divides the output clock by: 0: /1, 1: /2,
  1055.             2: /4, 3: /8
  1056. Resultant clock is: REF*(M+1)/((N1+1)*(2^N2)), where REF is the reference
  1057. clock, typically 14.31818MHz.
  1058.  
  1059. REG06 (R/W):  Command Register
  1060. bit   0  Powers down the DAC if set
  1061.     5-7  Mode. 5: 15bit, 6: 16bit, 7: 24bit
  1062. Note: This register can be accessed by reading REG02 3 times, then the fourth
  1063.       read will return the device ID and then the next read or write of REG02
  1064.       will access this register. Any access of REG00, REG01 or REG03 or writes
  1065.       to REG02 will terminate the access to this register, however reading of
  1066.       REG02 will not (DAC type 4i-1wNr).
  1067.       The MU9c9910 has ID 44h, the MU9c4910 has ID 82h, the MU9c4870 ??
  1068.  
  1069. REG07 (R/W):  PLL Read Index Register                              (9910 only)
  1070. bit 0-3  Selects the index register which will be accessed by the next read
  1071.          to REG05.
  1072.  
  1073.  
  1074.  
  1075.  
  1076. MUSIC MU9c9750 Low Power SYNDAC:
  1077. REG04 (R/W):  PLL Write Address Register
  1078. bit 0-3  Selects the index register which will be accessed by the next write
  1079.          to REG05.
  1080.  
  1081. REG05 (R/W):  PLL Parameters
  1082. The PLL registers accessed at this register are indexed via REG04 (writes) and
  1083. REG07 (reads). As all but index 0Eh are two byte registers which are accessed
  1084. via two reads or writes (low byte first) each of the indexes have an internal
  1085. flip-flop to track low/high byte. Each read of REG05 will increment the read
  1086. index (with the flip-flop incremented first). Writes increment the write
  1087. index (REG04) similarly.
  1088.  
  1089. REG05 index 00h - 07h W(R/W):  CLK0 f0-f7 PLL Parameters
  1090. bit  0-6  M. Numerator.
  1091.     8-11  N1. Quotient. Prescales REF for the PLL.
  1092.    12-13  N2. Clock divider. Divides the output clock by: 0: /1, 1: /2,
  1093.             2: /4, 3: /8
  1094.    14-15  PLL Mode Select. 0: Normal PLL mode - the output frequency is
  1095.           calculated as: f=REF*(M+1)/((N1+1)*(2^N2)), 1: High-resolution
  1096.           Low-frequency mode - same as PLL mode, but the output clock is
  1097.           divided by 1024, 2: OFF - The output is set HIGH, 3: Low-resolution
  1098.           Low-frequency mode - Output clock is: f=REF/((M+1)*(2^N2))
  1099. REF is the reference clock, typically 14.31818MHz. For best results the
  1100. following constraints should be observed: REF should be in the 5MHz - 32Mhz
  1101. range. REF/(N1+1) should be in the 2MHz - 16MHz range (for REF=14.31818MHz
  1102.  N1 should be in the range 1-6) and REF*(M+1)/(N1+1) should be in the 40MHz
  1103.  to 80MHz range.
  1104.  
  1105. REG05 index 08h W(R/W):  CLK0 fL0 PLL Parameters
  1106. Defines the CLK0 output when in LCD mode. Same format as index 0-7
  1107.  
  1108. REG05 index 09h W(R/W):  CLK0 fD0 PLL Parameters
  1109. Defines the CLK0 output when in Dormant mode. Same format as index 0-7
  1110.  
  1111. REG05 index 0Ah W(R/W):  CLK1 fA PLL Parameters
  1112. Defines the CLK1 output when in CRT mode and bit 4 of the PLL Control Register
  1113.  (index 0Eh) is clear. Same format as index 0-7
  1114.  
  1115. REG05 index 0Bh W(R/W):  CLK1 fB PLL Parameters
  1116. Defines the CLK1 output when in CRT mode and bit 4 of the PLL Control Register
  1117.  (index 0Eh) is set. Same format as index 0-7
  1118.  
  1119. REG05 index 0Ch W(R/W):  CLK1 fL1 PLL Parameters
  1120. Defines the CLK1 output when in LCD mode. Same format as index 0-7
  1121.  
  1122. REG05 index 0Dh W(R/W):  CLK1 fD1 PLL Parameters
  1123. Defines the CLK1 output when in Dormant mode. Same format as index 0-7
  1124.  
  1125. REG05 index 0Eh (R/W):  PLL Control Register
  1126. bit  0-2  CLK0 Select. Selects the CLK0 output in CRT mode (f0 - f7).
  1127.        4  CLK1 Select. Selects the CLK1 output in CRT mode. 0: fA, 1: fB
  1128.        5  CLK0 External Select Enable. If clear the CLK0 definition (f0-f7)
  1129.           is selected by the CS0-CS2 inputs, if set it is selected by bits
  1130.            0-2 of this register
  1131.        6  CLK0 Master Powerdown. If set the CLK0 PLL is powered down and the
  1132.           output is set HIGH.
  1133.        7  CLK1 Master Powerdown. If set the CLK1 PLL is powered down and the
  1134.           output is set HIGH.
  1135.  
  1136. REG06 (R/W):  Command Register
  1137. bit   0  LCD mode enable. If set the DAC goes into LCD mode where video flow
  1138.          through the DACs is stopped and the palette RAM is only accessed
  1139.          to service uP read/writes. The clocks CLK0,CLK1 are forced to the
  1140.          state defined in fL0/fL1 regardless of the state of the PLL Control
  1141.          register. The internal state of registers and palette RAM is
  1142.          maintained. See note
  1143.       6  Dormant Mode enable. If set the DAC goes into Dormant mode where
  1144.          the video flow though the DACs and the uP interface is stopped.
  1145.          The clocks CLK0,CLK1 are forced to the state defined in fD0/fD1
  1146.          regardless of the state of the PLL Control register. The internal
  1147.          state of registers and palette RAM is maintained. See note
  1148. Note: The CRT, LCD and Dormant modes are selected by a combination of the
  1149.       bits in this register and the PD0,PD1 input pins (x is don't care):
  1150.  PD1:  PD0:  Bit 6:  Bit 0:   Mode:  DAC:  RAM Access:   CLK0:    CLK1:
  1151.   1     0      0       0       CRT    On    Video&uP     f0-f7    fA,fB
  1152.   x     1      0       0       LCD    Off      uP         fL0      fL1
  1153.   1     0      0       1       LCD    Off      uP         fL0      fL1
  1154.   0     0      x       x     Dormant  Off     None        fD0      fD1
  1155.   x     x      1       x     Dormant  Off     None        fD0      fD1
  1156. Setting PD1=1 and PD0=0 allows full control from this register
  1157.  
  1158. REG07 (R/W):  PLL Read Address Register
  1159. bit  0-3  Selects the index register which will be accessed by the next read
  1160.           to REG05.
  1161.  
  1162.  
  1163.  
  1164.  
  1165. Oak OTI-66HC HiColor DAC:
  1166. REG06 (R/W):  "Hidden" Command Register
  1167. bit   0  If set the DAC powers down
  1168.     5-7  DAC mode. 5: 15bit, 6: 16bit
  1169. Note: This register can be accessed by reading REG02 4 times, then the next
  1170.       read or write of REG02 will access this register. Any access of REG00,
  1171.       REG01 or REG03 or writes to REG02 will terminate the access to this
  1172.       register, however reading of REG02 will not (DAC type 4-1wNr).
  1173.  
  1174.  
  1175.  
  1176.  
  1177. S3 86c708 (GenDac aka ICS5342) and 86c716 (SDAC aka ICS5300).
  1178.  
  1179. REG02 (R):  "Hidden DAC" register                                     (86c716)
  1180. Bit  4-7  7 for the 86c716.
  1181. Note: This is a special register overlaying the PEL register activated by an
  1182.       internal counter. Each access to 3C7h-3C9h resets the counter and each
  1183.       access to 3C6h increments it. When the counter reaches 4 this register
  1184.       is returned. The fifth read returns another register
  1185.  
  1186. REG04 (R/W):  PLL Write Register
  1187. bit  0-7  Controls the indexed register written at REG05. Each indexed
  1188.           register holds two bytes at the same index. Autoincremented after
  1189.           every two writes of REG05.
  1190.  
  1191. REG05 index 00h W(R/W):  f0 PLL M & N1/M2 divider
  1192. bit  0-6  M.  Quotient. Stored as 1-127, actual value 3-129
  1193.     8-12  N1. Frequency divider. Stored as 1-31, actual value 3-33
  1194.    13-15  N2. Divides the frequency. 0: /1, 1: /2, 2: /4, 3: /8
  1195. Note: Defines the frequency generate when clock 0 is selected
  1196. Note: See index 02h for details
  1197.       Possibly hardwired to 25.175MHz
  1198.  
  1199. REG05 index 01h W(R/W):  f1 PLL M & N1/M2 divider
  1200. bit  0-6  M.  Quotient. Stored as 1-127, actual value 3-129
  1201.     8-12  N1. Frequency divider. Stored as 1-31, actual value 3-33
  1202.    13-15  N2. Divides the frequency. 0: /1, 1: /2, 2: /4, 3: /8
  1203. Note: Defines the frequency generate when clock 1 is selected
  1204. Note: See index 02h for details
  1205.       Possibly hardwired to 28.322MHz
  1206.  
  1207. REG05 index 02h W(R/W):  f2 PLL M & N1/M2 divider
  1208. bit  0-6  M.  Quotient. Stored as 1-127, actual value 3-129
  1209.     8-12  N1. Frequency divider. Stored as 1-31, actual value 3-33
  1210.    13-15  N2. Divides the frequency. 0: /1, 1: /2, 2: /4, 3: /8
  1211. Note: Defines the frequency generate when clock 2 is selected
  1212. Note: Frequency is (M/N1)/(1 << N2) *base frequency.M and N1 are the actual
  1213.       values, not the stored ones. Typically the base frequency is 14.318 MHz.
  1214.  
  1215. REG05 index 03h W(R/W):  f3 PLL M & N1/M2 divider
  1216. bit  0-6  M.  Quotient. Stored as 1-127, actual value 3-129
  1217.     8-12  N1. Frequency divider. Stored as 1-31, actual value 3-33
  1218.    13-15  N2. Divides the frequency. 0: /1, 1: /2, 2: /4, 3: /8
  1219. Note: Defines the frequency generate when clock 3 is selected
  1220. Note: See index 02h for details
  1221.  
  1222. REG05 index 0Ah W(R/W):  Memory Clock
  1223. bit  0-6  M.  Quotient. Stored as 1-127, actual value 3-129
  1224.     8-12  N1. Frequency divider. Stored as 1-31, actual value 3-33
  1225.    13-15  N2. Divides the frequency. 0: /1, 1: /2, 2: /4, 3: /8
  1226. Note: Defines the frequency generate for the memory clock
  1227. Note: See index 02h for details
  1228.  
  1229. REG05 index 0Eh W(R/W):  PLL Control
  1230.  
  1231.  
  1232. REG06 (R/W):  Enhanced Command Register
  1233. bit 4-7  Mode: 0: Palette (1 pixel/VCLK), 1: Palette (2 pixels/VCLK), 2: 15bit
  1234.           (2 VCLKs/pixel), 3: 15bit (1 VCLK/pixel), 4: 24bit (3 VCLKs/pixel)
  1235.           - GenDAC only?, 5: 16bit (1 VCLK/pixel), 6: 16bit (2 VCLKs/pixel),
  1236.           7: 32bit (2 VCLKs/pixel), 0Eh: 24bit (3 VCLKs/pixel)
  1237.  
  1238. REG07 (R/W):  PLL Read Register
  1239. bit  0-7  Controls the indexed register read from REG05. Each indexed
  1240.           register holds two bytes at the same index. Autoincremented after
  1241.           every two reads of REG05.
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247. SGS-Thompson STG1700/2/3 Truecolor DACs:
  1248. All the STG DACs have 16bit pixel data path, but the 1700 can not use the
  1249. packed 24bit mode where 2 pixels are transferred in 3 pixel clocks.
  1250. The 1703 has built-in clock generator.
  1251.  
  1252. REG04 (R/W):  Index Low
  1253. bit  0-7  Index for the register accessible via REG05. The high byte (always
  1254.            0) is in REG07.
  1255.  
  1256. REG05 (R/W):  Indexed Register
  1257. There are a series of indexed registers in the STG DACs. If REG06 bit 4 is set
  1258. they are accessed by the two index bytes to REG02 and then reading or writing
  1259. the indexed registers at REG02 (index will autoincrement). If REG06 bit 4 is
  1260. clear the index is written to REG04 & REG07 and the indexed register are read
  1261. or written at REG05.
  1262.  
  1263. REG05 index 00h (R):  Company ID
  1264. bit 0-7  44h for SGS-Thompson, 97h for ??
  1265.  
  1266. REG05 index 01h (R):  Device ID
  1267. bit 0-7  00h for STG1700, 02h for STG1702, 03h for STG1703
  1268.  
  1269. REG05 index 02h (R/W?):
  1270. bit 0-7  A1h ??
  1271.  
  1272. REG05 index 03h (R/W?):  Primary Pixel Mode
  1273. bit 0-7  Mode (this register only active if REG06 bit 3 set):
  1274.           2: 15bit 1VCLK per pixel
  1275.           3: 16bit 1VCLK per pixel
  1276.           4: 24bit 2VCLKs per pixel (2x 16bit -> 1x 24bit)
  1277.           5:  8bit 1/2 VCLKs per pixel (ie. 16bit -> 2x 8bit)
  1278.           9: (not 1700) 24bit 3/2 VCLKs per pixel (3x 16bit -> 2x 24bit)
  1279.  
  1280. REG05 index 04h (R/W?):  Secondary Pixel Mode
  1281. bit 0-7  same as index 3 ??
  1282.  
  1283. REG05 index 05h (R/W?):  PLL Control
  1284. bit 0-7  02h - for double clocking (16bit) ???
  1285.  
  1286. REG05 index 06h (R/W?):
  1287. bit 0-7  00h ??
  1288.  
  1289. REG05 index 07h (R/W?):
  1290. bit 0-7  88h ??
  1291.  
  1292. REG05 index 20h W(R/W):
  1293. bit  0-7  B. Quotient
  1294.     8-12  N1. Frequency divider.
  1295.    13-15  Divider (D). 0: /1, 1: /2, 2: /4, 3: /8
  1296. The effective clock is: Ref*D*(B+2)/(N1+2). Ref is the reference clock,
  1297. typically 14.31818MHz
  1298.  
  1299. REG06 (R/W):  Pixel Command Register
  1300. bit   0  Power down the DAC if set
  1301.       1  Set to get 8bit DACs in 256color mode, clear to get normal 6bit DACs
  1302.       2  Controls intensity ??
  1303.       3  If set the DAC is controlled by the indexed registers below.
  1304.       4  When set puts the dac into indexed mode, now write the index (2
  1305.          bytes) to this register, then each access to this register will read
  1306.          or write the particular indexed register and increment the index.
  1307.          This is the same index as in REG04/REG07.
  1308.     5-7  Selects the Hi/True color mode:  0: Standard (16/256color),
  1309.            5: 15bit(32K), 6: 16bit(64K), 7: 24bit(16m)
  1310. Note: This register can be accessed by reading REG02 4 times, then the next
  1311.       read or write of REG02 will access this register. Any access of REG00,
  1312.       REG01 or REG03 will terminate the access to this register, The register
  1313.       can only be read or written once per unlock sequence (DAC type 4-1w1r).
  1314.  
  1315. REG07 (R/W):  Index High
  1316. bit  0-?  High byte of the index in REG04. 0 for all current registers.
  1317.  
  1318.  
  1319.  
  1320. Sierra SC15021,25/6 Truecolor DACs:
  1321. The SC15021 supports 16bit pixel data path.
  1322.  
  1323. REG04 (R/W):  Overlay Write Address
  1324.  
  1325. REG05 (R/W):  Overlay Data
  1326.  
  1327. REG06 (R/W):  Command Register
  1328. bit 1-2  EXT mode select ?
  1329.       3  Gamma Correction enabled if set?
  1330.       4  If set 3C7h is the index port and 3C8h the data port for an extra
  1331.          register, also this register is then accessible directly at 3C6h.
  1332.   0,5-7  Mode:
  1333.            00h  Palette modes
  1334.            04h  32bit RGBx (red first) "double clocked" -  pixel data on both
  1335.                 rising and falling edge of the dotclock
  1336.            05h  32bit BGRx (blue first) "double clocked"
  1337.            06h  24bit RGB/32bit RGBx (red first)
  1338.            07h  24bit BGR/32bit BGRx (blue first)
  1339.            08h  15bit (32K colors) "double clocked"
  1340.            09h  15bit (32K colors) "EXT" "double clocked"
  1341.            0Ah  15bit (32K colors)
  1342.            0Bh  15bit (32K colors) "EXT"
  1343.            0Ch  16bit (64K colors) "double clocked"
  1344.            0Eh  16bit (64K colors)
  1345. Note: This register can be accessed by reading REG02 4 times, then the next
  1346.       read or write of REG02 will access this register. Any access of REG00,
  1347.       REG01 or REG03 or writes to REG02 will terminate the access to this
  1348.       register, however reading of REG02 will not (DAC type 4-1wNr).
  1349.  
  1350. REG06 index 8 (R/W):  Auxiliary Control
  1351. bit    0  DAC and palette register width in palette modes.
  1352.           Set for 8bit and clear for 6 bit
  1353.        1  PED 75 IRE.
  1354.        2  Power Down.
  1355.  
  1356. REG06 index 9 (R):  ID1
  1357. bit  0-7  53h ('S')
  1358.  
  1359. REG06 index 0Ah (R):  ID2
  1360. bit  0-7  Version code. 0/36h/3Ah
  1361.  
  1362. REG06 index 0Bh (R):  ID3
  1363. bit  0-7  B1h for the SC15025/26, ACh for the SC15021
  1364.  
  1365. REG06 index 0Ch (R):  ID4
  1366. bit  0-7  41h
  1367.  
  1368. REG06 index 0Dh (R/W):  Pixel Mask Low
  1369. bit  0-7  ANDed with the pixel data, Low byte. Should normally be FFh.
  1370.  
  1371. REG06 index 0Eh (R/W):  Pixel Mask Middle
  1372. bit  0-7  ANDed with the pixel data, Middle byte. Should normally be FFh.
  1373.  
  1374. REG06 index 0Fh (R/W):  Pixel Mask High
  1375. bit  0-7  ANDed with the pixel data, High byte. Should normally be FFh.
  1376.  
  1377. REG06 index 10h (R/W):  Pixel Repack
  1378. bit    0  (15025/6) Set for 4x 8bit -> 1x 24bit, clear for 1x 8bit -> 8bit,
  1379.             2x 8bit -> 1x 16bit or 3x 8biot -> 1x 24bit
  1380.      0-3  (15021) Packaging: 2: 8bit -> 2x4bit, 4: 16bit -> 2x8bit,
  1381.              5: 3x16bit -> 2x24bit (2/3 clock), 6: 2x16bit -> 24bit (1/2
  1382.               clock), 8: 16bit -> 16bit (alternate?), 0: all others
  1383.  
  1384. REG06 index 11h (R/W):  Cursor                                         (15021)
  1385. bit  0-2  Cursor Delay. 0: None, 4: +1, 5: +2, 6: -1, 7: -2
  1386.      3-4  Cursor type. 0: disabled, 1: 3 colors, 2: 2 color MS-Windows style,
  1387.              3: 2 color X11 style
  1388.        7  Cursor Polarity
  1389.  
  1390. REG06 index 12h (R/W):  Secondary Control                              (15021)
  1391. bit  0-1  Mix control: 1: 8 -> 16 MixA or 8 -> 15 MixB, 2: 8 -> 16 MixB or
  1392.            8 -> 15 MixA, 0 for all others.
  1393.  
  1394. REG07 (R/W):  Overlay Read Address
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400. Trident TKD8001 24bit DAC (also 9200CXr,9400CXi,9420DGi internal DAC):
  1401.  
  1402. REG06 (R/W):  Command Register
  1403.       0  (not 9200) Power down DAC if set ?
  1404.       1  (not 9400) In mode 0 this bit when set selects 8bit DACs, when clear
  1405.           6bit DACs. Should be set in 24bit mode, clear in 15/16 bit modes ?
  1406.     5-7  Mode:  0: Palette (16/256), 5: 15bit (32k), 7: 16bit (64k),
  1407.           6: 24bit (16m colors) bit 2 should be set in this mode
  1408. Note:  This register can also be accessed at REG02 by reading REG02 four
  1409.        times. Then the command register can be read or written at REG02.
  1410.        This access will be terminated by any access to REG00, REG01 or REG03
  1411.        or after a write to the command register (DAC type 4-Nr1w).
  1412.  
  1413.  
  1414.  
  1415.  
  1416. Trident 9440AGi internal 24bit DAC:
  1417.  
  1418. REG06 (R/W):  Command Register
  1419.       2  If set in the 15/16/24 bit modes pixels with the most significant
  1420.          bit set appears to be displayed as if in palette mode ?
  1421.     4-7  Mode:  1: 15bit (32k), 3: 16bit (64k), 0Dh: 24bit (16m colors)
  1422.          All other values appears to default to palette mode
  1423. Note:  This register can also be accessed at REG02 by reading REG02 four
  1424.        times. Then the command register can be read or written at REG02.
  1425.        This access will be terminated by any access to REG00, REG01 or REG03
  1426.        or after a write to the command register (DAC type 4-Nr1w).
  1427.  
  1428.  
  1429.  
  1430.  
  1431. TI TLC34058, Brooktree Bt458 DACs
  1432. These DACs are intended for high bandwidth systems and are not VGA compatible.
  1433. They use 4 or 5 separate pixel ports in parallel for higher bandwidth
  1434.  
  1435. REG04 (R/W)  Index Register.
  1436. bit  0-7  Index for accesses through 3C6h, 3C7h and 3C9h. For 3C7h and 3C9h
  1437.           there is also an internal counter for the (Red, Green and Blue)
  1438.           cycle. This counter is reset when this register is written.
  1439.           Each access to 3C7h or 3C9h will increment first the RGB counter and
  1440.           then this register.
  1441.  
  1442. REG05 (R/W)  Palette Data
  1443. bit  0-7  Palette data port. 3C8h selects the entry in the palette RAM. Each
  1444.           read or write of this register increments index, first through the
  1445.           Red, Green & Blue and then increments register 3C8h
  1446.  
  1447. REG06 (R/W)  Control Data.
  1448. bit  0-7  Data port for the Control registers. 3C8h is the index. Unlike 3C7h
  1449.           and 3C9h the index in 3C8h is not increased by reads and writes of
  1450.           this register
  1451.  
  1452. REG06 index 4 (R/W):  Read Mask Register
  1453. bit  0-7  The pixel data is ANDed with this byte before being passed to the
  1454.           palette RAM. This is similar to 3C6h in standard VGA systems.
  1455.  
  1456. REG06 index 5 (R/W):  Blink Mask Register
  1457. bit  0-7  In the blink off period the pixel data is ANDed with the inverse of
  1458.           this register, Ie. the '0' bits in this register will protect the
  1459.           corresponding bits of the pixel data from blinking, while '1' bits
  1460.           will force the corresponding pixel data bits low during the blink
  1461.           off period.
  1462.  
  1463. REG06 index 6 (R/W):  Command Register
  1464. bit    0  OL0 Display Enable. If clear the overlay pin 0 (OL0) is forced to 0
  1465.        1  OL1 Display Enable. If clear the overlay pin 1 (OL1) is forced to 0
  1466.        2  OL0 Blink Enable. If set (and bit 0 set) the overlay pin 0 toggles
  1467.           between 0 and the actual value at the blink rate
  1468.        3  OL1 Blink Enable. If set (and bit 1 set) the overlay pin 1 toggles
  1469.           between 0 and the actual value at the blink rate
  1470.      4-5  Blink Rate Select. Selects the blink rate in vertical periods:
  1471.             0: 16on/48off, 1: 16on/16off, 2: 32on/32off, 3: 64on/64off
  1472.        6  RAM Enable. If the overlay select pins (OL0-1) are 0 this bit
  1473.           selects the output. Set for palette RAM data, clear for overlay
  1474.           register 0.
  1475.        7  Multiplex Select. Set for 5:1 multiplexing, clear for 4:1
  1476.           multiplexing - pixel port E is ignored and should be tied low
  1477.  
  1478. REG06 index 7 (R/W):  Test Register
  1479. bit  0-3  Selects the data to be returned in bit 4-7 when reading this
  1480.           register. Selects upper or lower 4 bits of one of the 3 DAC inputs:
  1481.               1: return 4MSB of Red         9: return 4LSB of Red
  1482.               2: return 4MSB of Green      10: return 4LSB of Green
  1483.               4: return 4MSB of Blue       12: return 4LSB of Blue
  1484.      4-7  (R) Data selected by bits 0-3
  1485.  
  1486. REG07 (R/W)  Overlay Data
  1487. bit  0-7  Overlay data port. 3C8h selects the entry in the overlay RAM (0-3).
  1488.           Each read or write of this register increments index, first through
  1489.           the Red, Green & Blue and then increments register 3C8h
  1490.  
  1491.  
  1492.  
  1493.  
  1494. TI TLC34075, ATI68875 True color DACs
  1495. This DAC has an 8bit VGA port and a 32bit pixelport (P). The 32bit pixelport
  1496. P can be multiplexed for greater bandwidth. 6 or 8 bit DACs can be controlled
  1497. via the 8/6 pin (low=6bit, high=8bit).
  1498.  
  1499. REG08 (R/W):  General Control Register
  1500. bit    0  If set HSYNCOUT is active high, active low if clear
  1501.        1  If set VSYNCOUT is active high, active low if clear
  1502.        2  Enables split shift register transfer (VRAM) if set
  1503.        3  Enables special nibble mode if set
  1504.        4  Pedestal Enable Control. Set for a 7.5 IRE pedestal, clear for a 0
  1505.           IRE pedestal
  1506.        5  Sync Enable Control. If set enables sync on green.
  1507.        7  MUXOUT. If set the MUXOUT output pin is high, low if clear
  1508. Note: bits 2 and 3 can not both be set.
  1509.  
  1510. REG09 (R/W):  Input Clock Selection Register
  1511. bit  0-3  Selects the clock source (DOTCLK):
  1512.             0: CLK0, 1: CLK1, 2: CLK2, 3: CLK3 (TTL), 4: /CLK3 (TTL)
  1513.             8: CLK3 and /CLK3 are selected as an ECL clock source
  1514.  
  1515. REG0A (R/W):  Output Clock Selection Register
  1516. bit  0-2  Selects SCLK from DOTCLK.
  1517.             0: SCLK=DOTCLK, 1: SCLK=DOTCLK/2, 2: SCLK=DOTCLK/4
  1518.             3: SCLK=DOTCLK/8, 4: SCLK=DOTCLK/16, 5: SCLK=DOTCLK/32
  1519.             6,7: SCLK held at logic low
  1520.      3-5  Selects VCLK from DOTCLK.
  1521.             0: VCLK=DOTCLK, 1: VCLK=DOTCLK/2, 2: VCLK=DOTCLK/4
  1522.             3: VCLK=DOTCLK/8, 4: VCLK=DOTCLK/16, 5: VCLK=DOTCLK/32
  1523.             6,7: VCLK held at logic high
  1524.  
  1525. REG0B (R/W):  MUX Control Register
  1526. bit  0-5  Selects bits/pixel, pixel port and multiplexing:
  1527.             0Dh  24bpp from P. Red=P8-15, Green=P16-23, Blue=P24-31
  1528.             10h  1bpp. 4 pixels/DOTCLK from P0-3
  1529.             11h  1bpp. 8 pixels/DOTCLK from P0-7
  1530.             12h  1bpp. 16 pixels/DOTCLK from P0-15
  1531.             13h  1bpp. 32 pixels/DOTCLK from P0-31
  1532.             14h  2bpp. 2 pixels/DOTCLK from P0-3
  1533.             15h  2bpp. 4 pixels/DOTCLK from P0-7
  1534.             16h  2bpp. 8 pixels/DOTCLK from P0-15
  1535.             17h  2bpp. 16 pixels/DOTCLK from P0-31
  1536.             18h  4bpp. 1 pixel/DOTCLK from P0-3
  1537.             19h  4bpp. 2 pixels/DOTCLK from P0-7
  1538.             1Ah  4bpp. 4 pixels/DOTCLK from P0-15
  1539.             1Bh  4bpp. 8 pixels/DOTCLK from P0-31
  1540.             1Ch  8bpp. 1 pixels/DOTCLK from P0-7
  1541.             1Dh  8bpp. 2 pixels/DOTCLK from P0-15
  1542.             1Eh  8bpp. 4 pixels/DOTCLK from P0-31
  1543.             1Fh  4bpp. 4 pixels/DOTCLK from P0-31   (Special Nibble mode)
  1544.                  If the NFLAG input is low the 4 pixels are from P0-3, P8-11,
  1545.                  P16-19, P24-27 if high from P4-7, P12-15, P20-23, P28-31
  1546.             2Dh  8bpp from VGA port
  1547.  
  1548. REG0C (R/W):  Palette Page Register
  1549. bit  0-7  For 1,2 and 4 bits/pixel modes the upper bits of this register are
  1550.           used to select 1 of 128, 64 and 16 pages respectively in the
  1551.           palette RAM. The pixel data selects the entry within the page.
  1552.  
  1553. REG0E (R/W):  Test Register
  1554. bit  0-2  (W) Test mode. Selects the current test mode. Reading this register
  1555.               will step to the next test (see Next below).
  1556.               Val:  Next:    Description:
  1557.                0      1      Read Color Palette Red value
  1558.                1      2      Read Color Palette Green value
  1559.                2      0      Read Color Palette Blue value
  1560.                3      0      Read Identification code.
  1561.                              Returns 75h for 34075
  1562.                4      5      Read Ones Accumulation Red value
  1563.                5      6      Read Ones Accumulation Green value
  1564.                6      4      Read Ones Accumulation Blue value
  1565.                7      7      Analog Test. Result specified below.
  1566.        3  (R) Analog Test result. Set if the voltage selected by bit 6 (Green)
  1567.                or bit 7 (Red) is larger than the one selected by bit 4 (145mV
  1568.                reference) or bit 5 (Blue), clear if not.
  1569.        4  Select 145mV reference if set. Only applies to Analog test (bit 0-2
  1570.            = 7)
  1571.        5  Select Blue DAC if set. Only applies to Analog test (bit 0-2 = 7)
  1572.        6  Select Green DAC if set. Only applies to Analog test (bit 0-2 = 7)
  1573.        7  Select Red DAC if set. Only applies to Analog test (bit 0-2 = 7)
  1574.  
  1575. REG0F (W):  Reset State
  1576. Note: Writing to this register will cause a hardware reset of the DAC.
  1577.  
  1578.  
  1579.  
  1580.  
  1581. TI Viewpoint TVP3010,TVP3020,TVP3025,TVP3026 DACs
  1582. Note: The TVP3010, TVP3020 and TVP3025 use 3 address lines to select 8 direct
  1583.       registers (REG00-REG07) while the TVP3026 uses 4 lines to select 16
  1584.       direct registers (REG00-REG0F). The indexed registers (called REG06
  1585.       index XXh) are also handled differently
  1586.  
  1587. REG06 (R/W):  Index Register
  1588. bit  0-7  Index port to the indexed registers. First set this register, then
  1589.           read or write REG07
  1590. Note: On the TVP3026 the index is written to REG00 and data is read or written
  1591.       to/from REG0A
  1592.  
  1593. REG06 index 00h W(R/W):  Cursor X Position
  1594. bit 0-11  Horizontal position of the cursor
  1595.  
  1596. REG06 index 02h W(R/W):  Cursor Y Position
  1597. bit 0-11  Vertical position of the cursor
  1598.  
  1599. REG06 index 04h (R/W):  Sprite Origin X
  1600.  
  1601. REG06 index 05h (R/W):  Sprite Origin Y
  1602.  
  1603. REG06 index 06h (R/W):  Cursor Control
  1604. bit    4  X Window Mode if set
  1605.        6  Sprite Enable if set
  1606.        7  (3025) Planar Access. Set for Bt485 mode, clear for 3020 mode
  1607.  
  1608. REG06 index 08h W(R/W):  Cursor RAM Address
  1609. bit 0-15  Index into the cursor RAM on the DAC. Data is read or written at
  1610.           index 0Ah. Each access to index 0Ah will autoincrement this register
  1611.  
  1612. REG06 index 0Ah (R/W):  Cursor RAM Data
  1613. bit  0-7  Cursor data. Reading or writing this register will access the
  1614.           location in Cursor RAM specified in index 8 and will increment that
  1615.           index to allow consecutive reads or writes.
  1616.           The cursor is stored as a 64x64x2 bitmap with 4 2bit pixels per byte
  1617.           The two bits are interpreted as:
  1618.           High (odd)  Low (even)    ix 6 bit 4=1   ix 6 bit 4=0
  1619.             bit         bit          X11 mode        "normal"
  1620.              0           0         Transparent     Color 0
  1621.              0           1         Transparent     Color 1
  1622.              1           0           Color 0       Transparent
  1623.              1           1           Color 1       Inverse screen (XOR)
  1624.           Color 0 is the color in index 23h-25h, Color 1 is the color in index
  1625.            26h-28h
  1626.  
  1627. REG06 index 0Eh (R/W):  True Color Control                              (3025)
  1628. bit    0  8bit mode?. 0: 16/32bit, 1: 4/8bit
  1629.        1  Non-VGA mode. Set for non-VGA mode, clear for VGA mode
  1630.        2  BTmode. Set for Bt485 mode, clear for TI3020 mode
  1631.  
  1632. REG06 index 0Fh (R/W):  VGA Switch Control                              (3025)
  1633.  
  1634. REG06 index 10h W(R/W):  Window Start X
  1635.  
  1636. REG06 index 12h W(R/A):  Window Stop X
  1637.  
  1638. REG06 index 14h W(R/W):  Window Start Y
  1639.  
  1640. REG06 index 16h W(R/W):  Window Stop Y
  1641.  
  1642. REG06 index 18h (R/W):  MUX Control 1
  1643. bit  0-2  (3020) Direct Color mode.
  1644.             3: Selects 6-6-4 16bit mode (6red-6green-4blue).
  1645.             4: Selects 5-5-5 15bit mode (5red-5green-5blue).
  1646.             5: Selects 5-6-5 16bit mode (5red-6green-5blue).
  1647.             6: Selects 8-8-8 24bit mode (8red-8green-8blue).
  1648.      0-3  (3025) Direct Color mode
  1649.              0Ch: Selects 5-5-5 mode (5red-5green-5blue).
  1650.              0Dh: Selects 5-6-5 mode (5red-6green-5blue).
  1651.              0Eh: Selects 8-8-8 mode (8red-8green-8blue).
  1652.        6  (3025) D/T mode. 0: Selects "D" mode, 1: selects "T" mode.
  1653.        7  Pseudo Color, set for palette modes
  1654.  
  1655. REG06 index 19h (R/W):  MUX Control 2
  1656.  
  1657.  
  1658. REG06 index 1Ah (R/W):  Input Clock Select
  1659. bit    0  (3020) If set selects ICLK1, if clear ICLK0
  1660.      0-2  (3025) Selects the input clock.
  1661.             0: ICLK0, 1: ICLK2, 2: ICLK2, 3: ICLK2_I ?, 4: ICLK2_E ?
  1662.             5: PLL as input clock.
  1663.        4  If set doubles the selected input clock.
  1664.  
  1665. REG06 index 1Bh (R/W):  Output Clock Select
  1666. bit  0-1  Multiplex. 0: (R1), 1: 1:2 Mux (1x64 -> 2x 24/32bit) R2, 2: 1:4 Mux
  1667.            (1x64 -> 4x 15/16bit) R4, 3: 1:8 Mux (1x64 -> 8x 8bit) R8
  1668.      3-4  Clock range. 0: <=60MHz (V1), 1: >60MHz & <=120MHz (V2), 2: >120MHz
  1669.            (V4), 3: V8
  1670.        6  S ?
  1671.        7  (3025) NS ?
  1672. Note: Set to 3Eh in VGA passthrough mode
  1673.  
  1674. REG06 index 1Ch (R/W):  Palette Page
  1675.  
  1676. REG06 index 1Dh (R/W):  General Control
  1677. bit    0  Vertical Sync Polarity. 0: Negative, 1: Positive
  1678.        1  Horizontal Sync Polarity. 0: Negative, 1: Positive
  1679.        5  Sync on Green if set
  1680.  
  1681. REG06 index 1Eh (R/W):  Misc Control                                    (3025)
  1682. bit    0  Powerdown
  1683.        1  Dotclock disable
  1684.        2  Internal 6/8 Control. If set selection of 6 or 8 bits DAC mode in
  1685.           palette modes is done by bit 3, if clear from the 6/8 input pin.
  1686.        3  8Bpp. If set selects 8bit DAC and palette registers in palette
  1687.           modes, if clear selects 6bit DAC & registers.
  1688.           This bit only active if bit 2 is set.
  1689.        5  VCLK Polarity.
  1690.        6  LCLK Latch. 0: VCLK
  1691.        7  Loop PLL RCLK.
  1692.  
  1693. REG06 index 20h (R/W):  Overscan Color Red
  1694.  
  1695. REG06 index 21h (R/W):  Overscan Color Green
  1696.  
  1697. REG06 index 22h (R/W):  Overscan Color Blue
  1698.  
  1699. REG06 index 23h (R/W):  Cursor Color 0 Red
  1700. bit  0-7  The red component of the cursor background color.
  1701.  
  1702. REG06 index 24h (R/W):  Cursor Color 0 Green
  1703. bit  0-7  The green component of the cursor background color.
  1704.  
  1705. REG06 index 25h (R/W):  Cursor Color 0 Blue
  1706. bit  0-7  The blue component of the cursor background color.
  1707.  
  1708. REG06 index 26h (R/W):  Cursor Color 1 Red
  1709. bit  0-7  The red component of the cursor foreground color.
  1710.  
  1711. REG06 index 27h (R/W):  Cursor Color 1 Green
  1712. bit  0-7  The green component of the cursor foreground color.
  1713.  
  1714. REG06 index 28h (R/W):  Cursor Color 1 Blue
  1715. bit  0-7  The blue component of the cursor foreground color.
  1716.  
  1717. REG06 index 29h (R/W):  Auxillary Control
  1718. bit    0  Window Complement if set
  1719.        3  (3020) Self Clock mode if set
  1720.  
  1721. REG06 index 2Ah (R/W):  General IO Control
  1722. bit  0-4
  1723.  
  1724. REG06 index 2Bh (R/W):  General IO Data
  1725.  
  1726. REG06 index 2Ch (R/W):  PLL Control                                     (3025)
  1727. bit  0-1  Write 0 to reset the internal counter for the PLL data registers
  1728.           Each write to index 2Dh/2Eh/2Fh will increment this field.
  1729.  
  1730. REG06 index 2Dh (R/W):  Pixel Clock PLL Data                            (3025)
  1731. bit  0-?  N. Divider (3-28). Stored as 1-26. Could probably be larger ??
  1732.     8-14  M. Divident (3-129). Stored as 1-127
  1733.    16-17  P. Clock multiplier. 0: *8, 1: *3, 2: *2, 3: *1
  1734.       19  PLL Enable. Enables the PLL clock if set
  1735. Note: This register consists of 3 bytes at the same index. Writing 00h to
  1736.       index 2Ch resets the internal counter so that the next access to this
  1737.       index accesses the first byte. Each access autoincrements the internal
  1738.       counter. The clock is calculated as: Ref * P * (M+2)/(N+2)
  1739.  
  1740. REG06 index 2Eh (R/W):  MCLK PLL Data                                   (3025)
  1741. bit  0-?  N. Divider (3-28). Stored as 1-26. Could probably be larger ??
  1742.     8-14  M. Divident (3-129). Stored as 1-127
  1743.    16-17  P. Clock multiplier. 0: *8, 1: *3, 2: *2, 3: *1
  1744.       19  PLL Enable. Enables the PLL clock if set
  1745.       23  Set when writing new PLL data ?
  1746.  
  1747. REG06 index 2Fh (R/W):  Loop Clock PLL Data                             (3025)
  1748. bit  0-?  N. Divider (3-28). Stored as 1-26. Could probably be larger ??
  1749.     8-14  M. Divident (3-129). Stored as 1-127
  1750.    16-17  P. Clock multiplier. 0: *8, 1: *3, 2: *2, 3: *1
  1751.       19  PLL Enable. Enables the PLL clock if set
  1752.  
  1753. REG06 index 30h W(R/W):  Color Key OLVGA
  1754.  
  1755. REG06 index 32h W(R/W):  Color Key Red
  1756.  
  1757. REG06 index 34h W(R/W):  Color Key Green
  1758.  
  1759. REG06 index 36h W(R/W):  Color Key Blue
  1760.  
  1761. REG06 index 38h (R/W):  Color Key Control
  1762.  
  1763. REG06 index 39h (R/W):  MCLK/DCLK Control                               (3025)
  1764.  
  1765. REG06 index 3Ah (R/W):  Sense Test
  1766.  
  1767. REG06 index 3Bh (R/W):  Test Data
  1768.  
  1769. REG06 index 3Ch W(R/W):  CRC
  1770.  
  1771. REG06 index 3Eh (R/W):  CRC Control
  1772.  
  1773. REG06 index 3Fh (R):  ID
  1774. bit  0-7  Chip ID. 20h for TVP3020, 25h for TVP3025, 26h for TVP3026
  1775.           Guess: 10h for TVP3010
  1776.  
  1777. REG06 index D5h (R/W):  Mode 85 Control                                 (3025)
  1778.  
  1779. REG0A (R/W): Data Register (3025)
  1780.  
  1781.  
  1782. UMC UM70c178 Hi-Color DACs:
  1783.  
  1784. REG06 (R/W):  Command Register
  1785. bit 0-4  (R) Always 0
  1786.     5-7  Mode: 5: 15bit, 7: 16bit.
  1787. Note:  This register can also be accessed at REG02 by reading REG02 four
  1788.        times. Then the command register can be read or written at REG02.
  1789.        This access will be terminated by any access to REG00, REG01 or REG03
  1790.        or after write of the command register.  (DAC type 4-Nr1w).
  1791.  
  1792.  
  1793.  
  1794.  
  1795. UMC UM70c188 TrueColor DACs:
  1796.  
  1797. REG06 (R/W):  Command Register
  1798. bit 0-3  (R) Always 0
  1799.       4  Set in 24bit mode, clear in all other modes
  1800.     5-7  Mode: 5: 15bit, 7: 16bit. Don't care for 24bit
  1801. Note:  This register can also be accessed at REG02 by reading REG02 four
  1802.        times. Then the command register can be read or written at REG02.
  1803.        This access will be terminated by any access to REG00, REG01 or REG03
  1804.        or after a read or write of the command register.  (DAC type 4-1r1w).
  1805.  
  1806.  
  1807.  
  1808.  
  1809.  
  1810. Forcing HiColor DACs into command mode:
  1811. Note: This works on the Sierra, ATT, Winbond DACs and clones, not on the
  1812.  Brooktree or TI DACs, also the MUSIC DACs will require an extra read of 3C6h.
  1813.  
  1814. procedure dactocomm;   {switches DAC to command register}
  1815. var x:word;
  1816. begin
  1817.   x:=inp($3C8);    {clear old state}
  1818.   x:=inp($3C6);
  1819.   x:=inp($3C6);
  1820.   x:=inp($3C6);    {Read $3C6 4 times.}
  1821.   x:=inp($3C6);
  1822. end;
  1823.  
  1824. Now reads and writes to $3C6 will access the command register. Depending on
  1825. the DAC type you may have multiple read/writes, one write/multiple reads or
  1826. one read/write of the command register before it switches back to the PEL
  1827. register. Any access to $3C7-$3C9 will switch back to the PEL mask register.
  1828.  
  1829.  
  1830. Forcing HiColor DACs into normal mode:
  1831.  
  1832. procedure dactopel;  {switches DAC back to normal mode}
  1833. var x:word;
  1834. begin
  1835.   x:=inp($3C8);
  1836. end;
  1837.  
  1838.  
  1839.  
  1840. function testdac:string;
  1841. var
  1842.   x,y,z,v,oldcommreg,oldpelreg:word;
  1843.  
  1844. type
  1845.   pel=record
  1846.         index,red,green,blue:byte;
  1847.       end;
  1848.  
  1849. procedure readpelreg(index:word;var p:pel);
  1850. begin
  1851.   p.index:=index;
  1852.   disable;
  1853.   outp($3C7,index);
  1854.   p.red  :=inp($3C9);
  1855.   p.blue :=inp($3C9);
  1856.   p.green:=inp($3C9);
  1857.   enable;
  1858. end;
  1859.  
  1860. procedure writepelreg(var p:pel);
  1861. begin
  1862.   disable;
  1863.   outp($3C8,p.index);
  1864.   outp($3C9,p.red);
  1865.   outp($3C9,p.blue);
  1866.   outp($3C9,p.green);
  1867.   enable;
  1868. end;
  1869.  
  1870. function setcomm(cmd:word):word;
  1871. begin
  1872.   dac2comm;
  1873.   outp($3c6,cmd);
  1874.   dac2comm;
  1875.   setcomm:=inp($3c6);
  1876. end;
  1877.  
  1878. procedure waitforretrace;
  1879. begin
  1880.   repeat until (inp(CRTC+6) and 8)=0;
  1881.   repeat until (inp(CRTC+6) and 8)>0;    {Wait until we're in retrace}
  1882. end;
  1883.  
  1884. function dacis8bit:boolean;
  1885. var
  1886.   pel2,x,v:word;
  1887.   pel1:pel;
  1888. begin
  1889.   pel2:=inp($3C8);
  1890.   readpelreg(255,pel1);
  1891.   v:=pel1.red;
  1892.   pel1.red:=255;
  1893.   writepelreg(pel1);
  1894.   readpelreg(255,pel1);
  1895.   x:=pel1.red;
  1896.   pel1.red:=v;
  1897.   writepelreg(pel1);
  1898.   outp($3C8,pel2);
  1899.   dacis8bit:=(x=255);
  1900. end;
  1901.  
  1902. function testdacbit(bit:word):boolean;
  1903. begin
  1904.   dac2pel;
  1905.   outp($3C6,oldpel and (bit xor $FF));
  1906.   dac2comm;
  1907.   disable;
  1908.   outp($3C6,oldcomm or bit);
  1909.   v:=inp($3C6);
  1910.   outp($3C6,v and (bit xor $FF));
  1911.   enable;
  1912.   testdacbit:=(v and bit)<>0;
  1913. end;
  1914.  
  1915. begin
  1916.  
  1917.   setDAC(_dac8,'Normal');
  1918.   dac2comm;
  1919.   oldcomm:=inp($3C6);
  1920.   dactopel;
  1921.   oldpel:=inp($3c6);
  1922.  
  1923.   dac2comm;
  1924.   outp($3c6,0);
  1925.   dac8:=dacis8bit;
  1926.   dac2pel;
  1927.  
  1928.   notcomm:=oldcomm xor 255;
  1929.   outp($3c6,notcomm);
  1930.   dac2comm;
  1931.   v:=inp($3c6);
  1932.   if v<>notcomm then
  1933.     if (setcomm($E0) and $e0)<>$e0 then
  1934.     begin           {Bits 5-7 of command register NOT writable.}
  1935.       dac2pel;
  1936.       x:=inp($3C6);
  1937.       repeat
  1938.         y:=x;         {wait for the same value twice}
  1939.         x:=inp($3C6);
  1940.       until (x=y);
  1941.       z:=x;
  1942.       dac2comm;
  1943.       if daccomm<>$8E then
  1944.       begin                 {If command register=$8e, we've got an SS24}
  1945.         y:=8;
  1946.         repeat
  1947.           x:=inp($3C6);
  1948.           dec(y);
  1949.         until (x=$8E) or (y=0);
  1950.       end
  1951.       else x:=daccomm;
  1952.       if x=$8e then setDAC(_dacss24,'SS24')
  1953.                else setDAC(_dac15,'Sierra SC11486');
  1954.       dac2pel;
  1955.     end
  1956.     else begin
  1957.       if (setcomm($60) and $E0)=0 then
  1958.       begin
  1959.         if (setcomm(2) and 2)>0 then setDAC(_dacatt,'ATT 20c490')
  1960.                                 else setDAC(_dacatt,'ATT 20c490');
  1961.       end
  1962.       else begin
  1963.         x:=setcomm(oldcomm);
  1964.         if inp($3c6)=notcomm then
  1965.         begin
  1966.           if setcomm($FF)<>$ff then setDAC(_dacadac1,'Acumos ADAC1')
  1967.           else begin
  1968.             dac8now:=dacis8bit;
  1969.             dac2comm;
  1970.             outp($3C6,(oldcomm or 2) and $FE);
  1971.             dac8now:=dacis8bit;
  1972.             if dac8now then
  1973.               if dacis8bit then setDAC(_dacatt,'ATT 20c491')
  1974.                            else setDAC(_dacCL24,'Cirrus 24bit DAC')
  1975.             else setDAC(_dacatt,'ATT 20c492');
  1976.           end;
  1977.         end
  1978.         else begin
  1979.           if trigdac=notcomm then setDAC(_dacCL24,'Cirrus 24bit DAC')
  1980.           else begin
  1981.             dac2pel;
  1982.             outp($3c6,$FF);
  1983.             case trigdac of
  1984.               $44:setDAC(_dacmus,'MUSIC ??');
  1985.               $82:setDAC(_dacmus,'MUSIC MU9C4910');
  1986.               $8e:setDAC(_dacss24,'Diamond SS2410');
  1987.             else
  1988.               if testdacbit($10) then setDAC(_dacsc24,'Sierra 16m')
  1989.               else if testdacbit(4) then setDAC(_dacUnk9,'Unknown DAC #9')
  1990.                                 else setDAC(_dac16,'Sierra 32k/64k');
  1991.             end;
  1992.           end;
  1993.         end;
  1994.       end;
  1995.     end;
  1996.  
  1997.     dac2comm;
  1998.     outp($3c6,oldcomm);
  1999.   end;
  2000.   dac2pel;
  2001.   outp($3c6,oldpel);
  2002.  
  2003.   if (dactype=_dac8) and (DAC_RS2<>0) and (DAC_RS3<>0) then
  2004.   begin
  2005.     oldpel :=inp($3C6);
  2006.     oldcomm:=inp($3C6+DAC_RS2);
  2007.     outp($3C6+DAC_RS2,oldpel xor $FF);
  2008.     if (inp($3C6)=oldpel) and (inp($3C6+DAC_RS2)=(oldpel xor $FF)) then
  2009.       SetDAC(_dacBt484,'Brooktree Bt484');
  2010.  
  2011.     outp($3C6+DAC_RS2,oldcomm);
  2012.     outp($3C6,oldpel);
  2013.   end;
  2014.  
  2015.  
  2016.  
  2017.   if dactype=_dac8 then
  2018.   begin
  2019.     WaitforRetrace;
  2020.     outp($3C8,222);
  2021.     outp($3C9,$43);
  2022.     outp($3C9,$45);
  2023.     outp($3C9,$47);    {Write 'CEGEDSUN' + mode to DAC index 222}
  2024.     outp($3C8,222);
  2025.     outp($3C9,$45);
  2026.     outp($3C9,$44);
  2027.     outp($3C9,$53);
  2028.     outp($3C8,222);
  2029.     outp($3C9,$55);
  2030.     outp($3C9,$4E);
  2031.     outp($3C9,13);     {Should be in CEG mode now}
  2032.     outp($3C6,255);
  2033.     x:=(inp($3c6) shr 4) and 7;
  2034.     if x<7 then
  2035.     begin
  2036.       setDAC(_dacCEG,'Edsun CEG rev. '+chr(x+48));
  2037.       WaitforRetrace;
  2038.       outp($3C8,223);
  2039.       outp($3C9,0);    {Back in normal dac mode}
  2040.     end;
  2041.   end;
  2042. end;
  2043.  
  2044.  
  2045. This ID's all known DAC types, except:
  2046.  - Sierra "mark2" and "Mark3" are all ID'd as Mark 3.
  2047.  
  2048.  - Avance Logic ALG1101 DAC can not be ID'd.
  2049.  
  2050.  - TI 34075, ATI 68830, 68860 and 68875 can not be ID'd
  2051.  
  2052.  - The Edsun CEG test has not been verified.
  2053.